Skip to content
Tutorials Center
My learning

Topics

Lesson 21 of 36 ยท Technical SEO

Canonicals, Redirects and Duplicate Content

Understand duplicate content, rel=canonical, 301 and 302 redirects, redirect chains and HTTP status codes, and learn to fix them with practical examples.

The same content often lives at more than one URL: with and without www, with a trailing slash, with tracking parameters, in a print view, or in a sorted list. Search engines try to pick one version to show, and they do not always pick the one you want. Canonical tags, redirects and correct status codes are how you tell them which one is the real page.

What duplicate content is (and is not)

Duplicate content means substantially the same content reachable at different URLs. It is rarely a "penalty". The practical problems are that ranking signals get split across versions, crawl time is wasted, and the wrong URL may appear in results.

Common causes:

  • http:// and https://, www and non-www
  • Trailing slash and no trailing slash, upper and lower case paths
  • Tracking parameters (?utm_source=...), session IDs, sort and filter parameters
  • Printer-friendly pages, AMP-style copies, paginated or tag archives
  • The same product in several categories
  • Syndicated copies of your article on other sites

rel=canonical

A canonical link says "this is the preferred URL for this content". Put it in the <head>:

HTML
<link rel="canonical" href="https://example.com/running/shoes">

Rules of thumb:

  • Use an absolute URL, with the protocol and host you want.
  • Every indexable page should have a self-referencing canonical.
  • The canonical target must return 200, be indexable and not itself point elsewhere.
  • It is a hint, not a command. If your other signals (redirects, internal links, sitemap) disagree, the engine may ignore it.
  • Only one canonical per page; put it in the head, not the body.
  • For non-HTML files such as PDFs, send it in an HTTP Link header.

Do not canonicalize paginated pages 2, 3, 4 to page 1; each page lists different items and should canonicalize to itself.

Does this page agree with itself?

Redirects

When a page moves for good, use a redirect so users and signals follow it.

Status Name Use
301 Moved Permanently Page moved for good; signals pass to the new URL
308 Permanent Redirect Like 301 but keeps the HTTP method
302 Found Temporary move
307 Temporary Redirect Temporary, keeps the method

Redirect best practices:

  • Redirect to the most relevant new page, not blindly to the home page.
  • Avoid chains (A to B to C) and loops; point every old URL directly at the final one.
  • Redirect once at the server level; do not rely on JavaScript or meta refresh.
  • Update internal links and the sitemap so they use the final URL, not the redirect.
  • Force a single version of the site: one protocol (HTTPS), one host (with or without www), one trailing-slash style.
  • Keep redirects in place for a long time (at least a year) when URLs change during a migration.
flowchart LR
  A["http://example.com/shoes"] -->|301| B["https://example.com/shoes"]
  B -->|301| C["https://www.example.com/shoes"]
  C -->|301| D["https://www.example.com/running/shoes"]

A redirect chain: three hops where one would do. Point the first URL straight to the last.

Python Find chains and loops

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Status codes that matter

  • 200: the page is fine.
  • 301/308: permanent move.
  • 404: not found. Normal for pages that never existed; fine for deleted content with no replacement.
  • 410: gone on purpose; engines drop it a little faster.
  • 5xx: server error. Repeated errors can reduce crawling and cause pages to drop out.
  • Soft 404: a "not found" page that returns 200. Engines may treat it as an error; return a real 404 status.

Also keep parameter handling tidy: if filters generate duplicate lists, canonicalize them to the unfiltered category unless a filtered view has its own search demand.

Handling syndicated content

If another site republishes your article, ask them to add a canonical link pointing to your original, or at least a clear link back. Search engines will usually, but not always, show the original.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which tag tells search engines the preferred URL for a page?

    rel=canonical declares the preferred version among duplicate or near-duplicate URLs.
  2. 2. A product moved permanently to a new URL. Which redirect fits?

    A 301 (or 308) is a permanent redirect and passes signals to the new URL.
  3. 3. What is a soft 404?

    The page says not found but the status code says OK, which confuses crawlers.
  4. 4. Why avoid redirect chains?

    Each extra hop adds latency and a chance of failure; redirect directly to the final URL.

Summary

  • Duplicate URLs split signals; choose one preferred URL for each page.
  • Use self-referencing absolute rel=canonical tags as hints.
  • Use 301/308 for permanent moves and avoid chains and loops.
  • Return correct status codes; avoid soft 404s.
  • Make internal links and sitemaps use the final canonical URLs.

Next: Core Web Vitals and Page Speed