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.
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.
INSIDE THIS GUIDE
8 chapters. Jump to any of them.
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.
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.'
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.
| Code | Meaning | Passes ranking signals | Method preserved | Use it for |
|---|---|---|---|---|
| 301 | Moved permanently | Yes, the strong default | Not guaranteed | Slug changes, consolidation, domain moves, retiring pages |
| 302 | Found / temporary | No, original stays indexed | Not guaranteed | Genuinely temporary diversions you will revert |
| 307 | Temporary, method-preserving | No, original stays indexed | Yes, strictly | HSTS upgrades, temporary moves involving POST |
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.
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/">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.
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 source | Right fix | Why |
|---|---|---|
| http vs https | 301 redirect to https | One version should serve content; signals must consolidate |
| www vs non-www | 301 redirect to chosen host | Same as above, pick one and enforce it |
| Trailing slash variants | 301 to your chosen policy | Two URLs for one resource; force a single form |
| Tracking parameters (utm, etc.) | rel=canonical to clean URL | The parameterized URL must keep working for analytics |
| Faceted / filtered navigation | Canonical or noindex, case by case | Some facets deserve to rank, most do not |
| Renamed old categories | 301 to the new category | Legacy 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.
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.
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.
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 200The 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.
| Signal | Tool | What a problem looks like |
|---|---|---|
| 404 spike | Search Console coverage | A redirect broke or a URL moved without one |
| Redirect chains | Site crawler audit | New rules stacking on old ones, equity dilution |
| Soft 404s | Search Console | Redirects pointing at irrelevant pages being ignored |
| Redirect loops | Uptime monitor following redirects | Conflicting rules, pages unreachable |
| Indexed old URLs | site: checks and Search Console | 302s 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
Should I use a 301 redirect or a canonical tag for duplicate content?expand_more
How long should I keep redirects in place after a migration?expand_more
Why are redirect chains a problem if they still reach the destination?expand_more
Is a JavaScript redirect bad for SEO?expand_more
What is the difference between a 302 and a 307 redirect?expand_more
Want this done for you?
I help brands win on Google and get cited in AI search. Tell me about your project.