Scobly

Guides · 2026-11-10 · 10 min read

Redirects for SEO: Fix Chains, Loops, and 404

Learn how to choose between 301, 308, 302, and 307 redirects, collapse multi-hop chains into single hops, fix loops, and recover link equity from 404s.

A server routing board where tangled, looping multi-step wire paths between old URL cards are bypassed by clean, direct single-line connections leading straight into green destination terminals, alongside a diagnostic terminal screen displaying HTTP status waveforms.

TL;DR

  • Use 301 redirects for permanent page migrations and 308 redirects when moving endpoints that must preserve POST request bodies.
  • Flatten multi-hop redirect chains so protocol, subdomain, trailing slash, and slug changes resolve in a single hop.
  • Break redirect loops by aligning SSL termination and trailing slash rules between your CDN edge and origin server.
  • Redirect broken 404 pages with backlinks to matching live topics, and serve 410 Gone for permanently deleted pages without equivalents.
  • Update internal links, canonical tags, and XML sitemaps so they point directly to final 200 OK addresses instead of redirected URLs.

What you need

You deploy a site migration or clean up old product routes, open your indexing report a week later, and find hundreds of pages dropped from search results. When server routes chain together, loop infinitely, or return unmapped 404 errors, search engines waste crawl budget and drop accumulated ranking signals.

Before you edit your routing rules, gather these essentials to audit and test your changes safely:

  • Server or edge configuration access: Permission to edit your Nginx, Apache, Cloudflare, Vercel, or application routing files.
  • Search Console and backlink exports: Access to Google Search Console coverage reports and a list of external backlinks pointing to legacy URLs.
  • Command-line HTTP client: A terminal with curl installed to inspect raw HTTP response headers and trace redirect hops without browser caching.
  • Staging environment: A non-production deployment where you can verify rewrite rules before shipping them to live traffic.

1. Choose the right HTTP redirect status code: 301 vs 308 and 302 vs 307

Selecting the right status code tells browsers and search crawlers whether a URL change is permanent or temporary.

Your second decision is how the server should treat the HTTP request method during the hop. While 301 and 302 codes historically allowed clients to rewrite POST requests into GET requests, 308 and 307 codes strictly forbid changing the request method or body.

When to use 301 vs 308 permanent redirects

For standard web page migrations, slug changes, and protocol upgrades, use a 301 Moved Permanently redirect. HTML pages are fetched via GET requests, so method rewriting is never an issue, and every crawler and proxy understands 301 rules.

Use a 308 Permanent Redirect when moving an endpoint that receives POST, PUT, or DELETE payloads, such as form submissions, webhook receivers, or API routes. If a client sends a POST request to a URL returning a 301, the client may convert that request into a GET and drop the payload entirely.

Watch out: Browsers cache 301 and 308 redirects indefinitely when no Cache-Control header is set. Always test new permanent routing rules in an incognito window or via command-line tools so a mistake does not get stuck in visitors' local browser caches.

When to use 302 vs 307 temporary redirects

Temporary redirects keep the original source URL in the search index and tell crawlers not to transfer permanent link equity to the target address. Use them only when you intend to restore the original URL shortly:

  • 302 Found: Best for temporary promotional pages, seasonal category routing, or A/B tests on standard GET web pages.
  • 307 Temporary Redirect: Best for temporary maintenance pages or server failovers where incoming POST form submissions must remain intact.
  • Geo-routing and language prompts: Avoid automatic permanent redirects based on IP location, which trap search crawlers originating from US data centers in a single locale.

HTTP redirect status codes

Code Persistence Method handling Primary engineering use case
301 Permanent May change POST to GET Page migrations, HTTP to HTTPS, and slug updates
308 Permanent Preserves POST and body Migrating API routes, webhooks, and form endpoints
302 Temporary May change POST to GET Seasonal promotions and temporary A/B page tests
307 Temporary Preserves POST and body Temporary maintenance mode on form or API routes
410 Permanent removal Not applicable Intentionally deleted pages with no replacement

2. Map and collapse multi-hop redirect chains into a single hop

A redirect chain happens when URL A redirects to URL B, which in turn redirects to URL C. Chains accumulate silently over years of redesigns as teams stack new rules on top of older ones without flattening the lookup table.

The most common four-hop chain starts with an unencrypted request that hops from HTTP to HTTPS, then to a www subdomain, then adds a trailing slash, and finally moves to a new slug. Each hop adds network round-trip latency for human visitors and increases the risk that crawlers abandon the request.

AI search crawlers and link preview bots often enforce much stricter timeouts and drop out after two or three hops.

Trace and flatten your redirect map

Follow this sequence to audit your live routing table and collapse every multi-hop path into a direct 301 response:

  1. Export your legacy URLs: Gather all known historical URLs from your backlink profile, old sitemaps, server access logs, and current rewrite configuration files.
  2. Trace hop counts from the command line: Run curl with location tracking enabled against your legacy URLs to inspect every intermediate Location header and status code.
  3. Consolidate canonical rules at the edge: Combine protocol (HTTPS), hostname (www or non-www), and trailing slash normalization into a single rule that evaluates the final target path at once.
  4. Rewrite legacy maps to point to final destinations: Update every historicalA-to-B rule in your lookup table so that both A and B point directly to the current live C address.
A before-and-after comparison showing how a 4-hop sequential redirect chain is flattened so every legacy URL variant routes in a single hop to the final destination.

3. Find and break infinite redirect loops across server and CDN layers

An infinite redirect loop occurs when URL A redirects to URL B and URL B redirects right back to URL A, resulting in an ERR_TOO_MANY_REDIRECTS browser error. When a page enters a loop, both human visitors and search crawlers are completely locked out, causing rapid deindexation.

Loops rarely happen inside a single configuration file. Instead, they happen when two different layers of your infrastructure disagree on what the canonical URL should look like.

Check these three common architectural conflicts when diagnosing a redirect loop:

  • CDN SSL mode vs origin server HTTPS rules: If your CDN terminates SSL and forwards requests to your origin over HTTP, an origin server configured to redirect all HTTP requests back to HTTPS will trigger an endless loop unless it checks the X-Forwarded-Proto header.
  • Edge trailing slash rules vs framework routing: If an edge worker strips trailing slashes while your application framework or static host automatically appends a trailing slash to directory paths, requests will bounce between the two layers forever.
  • Case-sensitivity mismatches: A rule that forces uppercase characters in URL slugs will clash with a CMS or router that automatically lowercases incoming paths.

Tip: To isolate which layer is causing a loop, inspect the Server and Via response headers on each hop using curl. You will immediately see one hop coming from your CDN edge and the opposing hop coming from your origin application server.

4. Audit 404 and 410 errors to recover lost link equity without creating soft 404s

Not every 404 Not Found status code is a technical problem that needs a redirect. When a page is legitimately gone, holds no external backlinks, and has no equivalent topic on your site, serving a clean 404 or 410 status code is the proper engineering response.

However, if a deleted or moved URL has external links from other websites or still receives organic traffic, leaving it as a 404 throws away that accumulated authority. You should map those high-value broken URLs via a 301 redirect to the closest matching live page on your site.

When to use 404 vs 410 Gone

Both 404 and 410 status codes tell search engines that a page does not exist and should be removed from the search index:

  • 404 Not Found: Use as your default response for mistyped URLs, broken external links you have not mapped yet, or products temporarily out of stock that might return.
  • 410 Gone: Use when you intentionally delete thin content, expired job listings, or discontinued product lines that will never return and have no replacement page.
  • Crawl budget impact: A 410 status signals immediate permanent removal, so search engines stop recrawling those addresses faster than standard 404s.

Why redirecting dead pages to your homepage causes soft 404s

A common mistake during site migrations is adding a blanket catch-all rule that redirects every unknown or deleted URL to the homepage. When a user or crawler requests a specific deep page and lands on a generic homepage that does not answer the original topic, search engines classify the destination as a soft 404.

Only redirect a dead URL when you have a genuine topic match, such as mapping a discontinued product model to its direct successor or parent category page.

Redirecting a dead page to the homepage with no topic match creates a soft 404.

5. Update internal links, canonical tags, and XML sitemaps to point directly to 200 OK URLs

Putting a 301 redirect in place is only half the cleanup job. If your own site navigation, blog posts, canonical tags, and sitemaps still point to the old redirected addresses, you force visitors and crawlers through unnecessary hops on every page load.

Search engines treat conflicting signals across redirects, canonicals, and sitemaps as a sign of poor site maintenance.

  • Internal anchor links: Crawl your site or search your repository templates to replace every internal href pointing to a 301 or 404 address with the final live URL.

6. Automate ongoing redirect and status code monitoring

It also checks the http, https, www, non-www, and trailing slash versions of those addresses to verify that they redirect properly, and tests internal links using HEAD requests where the server allows them.

If you connect your GitHub repository, the team can draft fixes to the files where a problem lives and open pull requests, or let you review every change first with Always review enabled in Settings.

FAQ

How long should I keep 301 redirects active after a site migration?

Keep permanent 301 redirects active for at least one year after a URL migration so search crawlers can process every historical path. If an old URL has high-authority external backlinks that you cannot get updated at the source, leave the 301 redirect in place indefinitely so you never lose that referral traffic or link equity.

Do JavaScript or meta refresh redirects pass SEO value like server-side redirects?

Server-side 301 and 308 redirects at the HTTP header level are always the fastest and most reliable option for search crawlers. Instant meta refresh tags and JavaScript redirects only work after a crawler renders the page, which wastes crawl budget and fails entirely for crawlers that do not execute JavaScript.

Should I redirect broken URLs that have no backlinks or traffic?

No. If an old or mistyped URL has zero external backlinks, zero internal links, and no organic traffic, adding a redirect just bloats your server routing configuration. Let those URLs return a clean 404 or 410 status code so search engines drop them from the index naturally.

Sources

  • HTTP Status Codes, Network and DNS Errors, and Google Search | Google Search Central

Meet yours today.

Today is the least it will ever know about your site.