PLAY 45

Redirects and Canonicalization: The Definitive Guide

Know exactly when to fire a 301, a 302, or a 307, and never guess again.

Consolidate duplicate, legacy, and parameter URLs without leaking ranking signals into a dead end.

Run a migration where redirects are tested before launch, not discovered in a traffic graph three weeks later.

8 min readUpdated 2026By Shmul

KEY TAKEAWAYS

  • check_circleDefault to 301 for permanent moves; reserve 302 and 307 for genuinely temporary diversions you intend to revert.
  • check_circleRedirect when only one version of the content should serve; use rel=canonical when multiple versions must keep working but only one should rank.
  • check_circleFlatten every redirect chain to a single hop and eliminate loops; both quietly tax crawl budget and dilute authority.
  • check_circleRedirect legacy URLs to their closest relevant replacement, never the homepage, and only after checking whether they carry links worth preserving.
  • check_circleIn migrations, build a one-to-one 301 map from a complete old-URL inventory, test it against staging before launch, and keep it live for at least a year.
  • check_circleTreat redirect testing and monitoring as a recurring audit; redirects fail silently, so a scheduled crawl plus 404 and loop monitoring is the only real safety net.
01

CHAPTER 01

Why Redirects and Canonicals Are the Same Conversation

Most people treat redirects and canonical tags as two separate tools learned at two separate times. That is the first mistake. They answer the same question from two different angles: when a piece of content lives at more than one address, which address is the real one? A redirect answers that question by force. A canonical tag answers it by suggestion. Once you see them as a pair, you stop misusing one where the other belongs.

bolt

A redirect changes the URL a user and a crawler land on. A canonical tag leaves the URL alone and tells search engines which version to credit. If you can serve only one version, redirect. If you must serve several versions but only want one to rank, canonicalize.

targetThe one rule that prevents 80 percent of redirect problems

Decide your canonical URL format once, write it down, and enforce it everywhere: protocol (https), host (www or non-www, pick one), trailing slash policy, and case. Every deviation from that format should either redirect to the canonical form or carry a canonical tag pointing at it. No exceptions, no 'we will fix it later.'

02

CHAPTER 02

301 vs 302 vs 307: What the Status Codes Actually Mean

The status code is not a formality. It is an instruction to every browser, proxy, and crawler about how to treat the move. Pick the wrong one and you either fail to pass ranking signals or you train caches to do something you will regret. Let me cut through the confusion, because there is a lot of folklore here.

Default to 301 for anything you mean to be permanent. Use 302 only when you genuinely intend to bring the original URL back. A 302 left in place for months tells search engines to keep the old URL indexed, which is the opposite of what most people want when they fire one.

lightbulbPRO TIP

If you are on HSTS (HTTP Strict Transport Security), the browser itself upgrades http to https with an internal 307 before any request leaves the machine. That 307 you see in your network tab is the browser enforcing HTTPS, not your server. Do not 'fix' it. It means your HSTS is working.

CodeMeaningPasses ranking signalsMethod preservedUse it for
301Moved permanentlyYes, the strong defaultNot guaranteedSlug changes, consolidation, domain moves, retiring pages
302Found / temporaryNo, original stays indexedNot guaranteedGenuinely temporary diversions you will revert
307Temporary, method-preservingNo, original stays indexedYes, strictlyHSTS upgrades, temporary moves involving POST
03

CHAPTER 03

Meta Refresh and JavaScript Redirects: Why I Avoid Them

Not every redirect happens at the server level. You can also redirect from inside the HTML with a meta refresh tag, or from inside the page with JavaScript. Both work in the sense that the browser ends up at the new URL. Both are also worse than a server-side redirect in almost every way that matters. Here is the case against each, and the narrow situations where you might still reach for them.

<!-- Meta refresh: avoid this for SEO redirects -->
<meta http-equiv="refresh" content="0; url=https://example.com/new-page/">

<!-- JavaScript redirect: also avoid for canonical moves -->
<script>
  window.location.replace("https://example.com/new-page/");
</script>

<!-- What you actually want: a server-side 301 (Apache example) -->
Redirect 301 /old-page/ https://example.com/new-page/

targetWhy server-side wins every time it can

A server-side redirect lives in the HTTP response, before the body. It is fast, unambiguous, and works for every client including those that do not run JavaScript. A meta refresh or JS redirect requires the page to load first, wastes time and crawl budget, and leaves room for misinterpretation. If you have access to your server config, a CDN edge function, or your platform's redirect manager, use it.

If a crawler has to render your page to learn that the page no longer exists, you have already lost the round. Put the move in the response, not the body.
04

CHAPTER 04

The Canonical Tag and When to Use It Instead of a Redirect

The rel=canonical tag is the most misunderstood element in technical SEO. People sprinkle it everywhere like seasoning and assume it will sort out their duplicate content. It will not, because a canonical is a hint, not a command. Understanding what it can and cannot do is what separates an SEO who fixes problems from one who creates new ones.

<!-- Self-referencing canonical on the master page -->
<link rel="canonical" href="https://example.com/blue-widgets/">

<!-- On a parameterized duplicate, point back at the clean URL -->
<!-- URL in browser: /blue-widgets/?utm_source=newsletter -->
<link rel="canonical" href="https://example.com/blue-widgets/">
bolt

Use a redirect when you can serve only one version of the content. Use a canonical when you must serve multiple versions but only want one of them to rank. Redirect for slug changes and dead pages. Canonicalize for tracking parameters, faceted navigation, syndicated content, and printer-friendly variants where the duplicate genuinely needs to keep working.

Never canonicalize a page that meaningfully differs from its target. Two product variants with different prices, different reviews, and different specs are not duplicates, and forcing a canonical between them tells search engines to drop one from the index. Reserve canonicals for true or near-true duplicates.

targetSelf-referencing canonicals are not optional

Every indexable page should carry a canonical tag pointing at itself, in the exact format you chose as canonical (right protocol, right host, right trailing-slash policy). This is not redundant. It defends you against parameter-laden versions of the URL, scraped copies, and accidental duplicates by stating plainly what the clean address is. A page with no canonical tag is a page leaving the decision to chance.

05

CHAPTER 05

Redirect Chains and Loops: The Silent Authority Tax

A single redirect is cheap. A chain of them is a tax you pay on every crawl and every visit. A loop is a wall a crawler hits and walks away from. Both are common, both are invisible until you look for them, and both are easy to create by accident over years of incremental changes. This is the maintenance work nobody schedules and everybody needs.

# A redirect chain (bad): three hops to reach the destination
http://example.com/old      301 -> https://example.com/old
https://example.com/old      301 -> https://example.com/new
https://example.com/new      301 -> https://example.com/products/new/

# Flattened (good): every source points directly at the final URL
http://example.com/old       301 -> https://example.com/products/new/
https://example.com/old      301 -> https://example.com/products/new/
https://example.com/new      301 -> https://example.com/products/new/

lightbulbPRO TIP

Redirect chains longer than a few hops risk being abandoned by crawlers before they reach the destination. The published guidance has varied over the years, but the safe engineering rule has not: keep every redirect to a single hop. Do not argue about whether the limit is three or five. Make it one.

targetHow to debug a redirect loop

Map the rules in the order your server evaluates them. Most loops come from two rules that each insist on a different canonical form. Combine them into a single rule that jumps straight to the final form in one move: enforce protocol, host, and trailing slash together, not in separate competing rules. Then test the exact failing URL with curl and follow the hops manually until the loop is gone.

06

CHAPTER 06

Consolidating Duplicate and Legacy URLs

Most sites accumulate duplicate addresses the way a garage accumulates boxes. Tracking parameters, session IDs, pagination quirks, old category structures, and the eternal www versus non-www question. Consolidation is the work of deciding which address is canonical and routing everything else to it. Done well, it concentrates your authority. Done badly, it scatters it.

Duplicate sourceRight fixWhy
http vs https301 redirect to httpsOne version should serve content; signals must consolidate
www vs non-www301 redirect to chosen hostSame as above, pick one and enforce it
Trailing slash variants301 to your chosen policyTwo URLs for one resource; force a single form
Tracking parameters (utm, etc.)rel=canonical to clean URLThe parameterized URL must keep working for analytics
Faceted / filtered navigationCanonical or noindex, case by caseSome facets deserve to rank, most do not
Renamed old categories301 to the new categoryLegacy URLs with links should pass equity to the replacement

Before you retire a legacy URL, check whether anything links to it. A legacy URL with strong backlinks is an asset, not garbage. Redirect it to the most relevant live page so that equity transfers. A legacy URL with no links and no traffic can often just 404 or 410. Audit before you decide, do not blanket-redirect everything to the homepage.

targetThe consolidation checklist

1. Enforce one protocol, one host, one trailing-slash policy, lowercase paths. 2. Add self-referencing canonicals to every indexable page. 3. Canonicalize parameter and facet variants to their clean URLs. 4. Pull a list of legacy URLs with inbound links or residual traffic. 5. Redirect each legacy URL to its most relevant live page, not the homepage. 6. Let truly orphaned, link-free dead URLs return 410. 7. Crawl the result and confirm no chains formed.

07

CHAPTER 07

Redirects in Site Migrations

A migration is where redirect discipline either saves you or sinks you. Change a domain, restructure your URLs, or replatform your CMS, and every old address must land somewhere sensible the moment the switch flips. Get the redirect map right and the migration is a non-event in your traffic graph. Get it wrong and you spend the next quarter explaining a cliff to whoever signs your invoices.

bolt

Build a one-to-one redirect map. Every old URL points to its closest equivalent on the new site, ideally the page that replaces it most directly. Resist the urge to bucket large swaths of old URLs into a single category page. Granular, relevant, one-to-one redirects preserve far more equity than lazy many-to-one mapping.

lightbulbPRO TIP

Use 301s for the migration, never 302s. A migration is permanent by definition. Firing 302s during a domain move is a classic way to keep the old domain indexed and stall the transfer of authority to the new one for months. If the move is real, say so with a 301.

targetMigration redirect sequence

1. Crawl and assemble the complete old-URL inventory from crawl data, analytics, Search Console, and backlinks. 2. Build a one-to-one redirect map to the closest new equivalents. 3. Have a human review the mapping for high-value pages. 4. Test the full map against staging: every source resolves with one 301 to a 200. 5. Keep the old XML sitemap available temporarily so engines recrawl old URLs and discover the moves. 6. Launch, then monitor crawl stats and 404s daily for the first weeks. 7. Keep migration redirects in place for at least a year, longer if links still point at the old URLs.

08

CHAPTER 08

Testing and Monitoring Redirects

A redirect you have not tested is a hypothesis. A redirect you are not monitoring is a hypothesis that can fail silently. The difference between a site that handles redirects well and one that does not is rarely knowledge of status codes. It is the presence of a feedback loop that catches problems before users and crawlers do. Here is how to build that loop.

# Follow a redirect and see every hop with its status code
curl -sIL https://example.com/old-page/ | grep -i -E "^(HTTP|location)"

# Expected for a clean single-hop 301:
# HTTP/2 301
# location: https://example.com/new-page/
# HTTP/2 200

# A chain looks like this (fix it):
# HTTP/2 301
# location: https://example.com/intermediate/
# HTTP/2 301
# location: https://example.com/new-page/
# HTTP/2 200

The three failures to hunt in every redirect audit: chains (more than one hop), loops (infinite bounce), and redirects that resolve to a 404 or 410 (you redirected to a page that no longer exists). Any of the three quietly leaks the equity the redirect was supposed to preserve.

SignalToolWhat a problem looks like
404 spikeSearch Console coverageA redirect broke or a URL moved without one
Redirect chainsSite crawler auditNew rules stacking on old ones, equity dilution
Soft 404sSearch ConsoleRedirects pointing at irrelevant pages being ignored
Redirect loopsUptime monitor following redirectsConflicting rules, pages unreachable
Indexed old URLssite: checks and Search Console302s used where 301s belonged
Redirects fail quietly. No error message reaches your inbox when a 301 turns into a chain or a target starts 404ing. The only thing standing between you and a slow leak is the audit you scheduled and actually ran.

Frequently asked

Does a 301 redirect pass all the ranking signals to the new URL?expand_more
A 301 passes the overwhelming majority of ranking signals, and current guidance is that this transfer is effectively complete for a relevant move. The catch is relevance: signals pass cleanly only when the target is a reasonable replacement for the original content. Redirect a page to an unrelated destination, such as the homepage, and the engine often treats it as a soft 404 and passes little or nothing.
Should I use a 301 redirect or a canonical tag for duplicate content?expand_more
Use a 301 when you can serve only one version of the content and want the others gone entirely, such as slug changes or http-to-https. Use a canonical tag when the duplicate must keep working, such as URLs carrying tracking parameters or faceted navigation, but you still want a single version to rank. The deciding question is whether the alternate URL needs to keep resolving.
How long should I keep redirects in place after a migration?expand_more
At least a year, and longer if external sites still link to the old URLs. Migration redirects are not temporary scaffolding; they pass equity for as long as anything points at the old addresses. Removing them too early reopens every consolidation you achieved and lets that authority leak away. Storage is cheap, so the safe default is to keep them indefinitely unless you have a strong reason not to.
Why are redirect chains a problem if they still reach the destination?expand_more
Each hop is a round trip that slows users and consumes crawl budget, and at every hop there is a small risk of signal loss. Long chains also risk crawlers abandoning the request before they reach the end. The fix is to flatten chains so every source URL points directly at the final destination in a single hop, which you enforce by checking whether a new redirect's target is itself a redirect.
Is a JavaScript redirect bad for SEO?expand_more
It is worse than a server-side redirect because the page must load and execute the script before the move is discovered, which wastes time and crawl resources and leaves room for misinterpretation. Search engines can process JavaScript redirects, but they do so on a slower second rendering pass. Use a server-side 301 whenever you have access to the server, CDN edge, or a redirect manager. Reserve client-side redirects for the rare case where you genuinely cannot issue a server response.
What is the difference between a 302 and a 307 redirect?expand_more
Both are temporary, and both leave the original URL indexed rather than passing signals to the target. The difference is method handling: a 302 historically allowed the request method to change, so a POST could become a GET, while a 307 strictly preserves the method. For SEO you treat them the same, and you will most often meet a 307 as the internal redirect a browser uses to enforce HSTS by upgrading http to https.

Want this done for you?

I help brands win on Google and get cited in AI search. Tell me about your project.

Work with me