Skip to main content
SEO / Web
Published 8 min read

What Are Redirect Chains? Causes, Impact and How to Fix Them

Several hops where one would do: how redirect chains form, what they cost, and how to find and fix them.

A redirect is a server saying "this page has moved, ask over there". A redirect chain happens when the place it points to is itself a redirect, and so on, until a page finally loads. Each hop costs a full network round trip, so a chain makes pages slower and makes your site harder to reason about.

An example

http://example.com/old-page
  -> 301 https://example.com/old-page      (HTTPS rule)
  -> 301 https://www.example.com/old-page  (www rule)
  -> 301 https://www.example.com/new-page  (renamed page)
  -> 200 OK

Three redirects before the visitor sees anything. Each was added at a different time by a different rule, and each makes sense on its own. The problem only shows when you follow the whole path. The fix is a single hop: http://example.com/old-page straight to https://www.example.com/new-page.

Why chains form

  • Layered rules: a server rule for HTTPS, another for the hostname, and a CMS plugin for slugs, each acting separately.
  • Site migrations stacked on top of older ones, so yesterday's destination became today's source.
  • Trailing-slash and lowercase normalisation applied as extra steps.
  • A CDN or proxy redirecting in addition to the origin server.
  • Internal links that still point at the old URL, so every click triggers the whole chain.

What chains cost

  • Speed. Every hop is a new request and response. On a mobile connection a few hops can add noticeable delay before the page even starts loading.
  • Crawling. Search engine crawlers follow redirects but only up to a limit, and each hop uses up crawl effort that could go to real pages, which matters most on large sites.
  • Reliability. The more rules involved, the more likely one will be changed and break the path.
  • Clarity. Analytics, canonical tags and backlinks all depend on knowing the final URL.

Redirect loops

A loop is a chain with no end. A common cause is an HTTPS rule behind a proxy that terminates TLS: the proxy talks plain HTTP to the server, the server keeps redirecting to HTTPS, and the cycle never breaks. Another is two rules that each enforce a different canonical hostname. Browsers detect loops and show an error after about twenty redirects.

How to find chains

From a terminal, curl can show every hop without a browser's caching:

curl -sIL http://example.com/old-page | grep -iE '^(HTTP|location)'

The -L flag follows redirects, -I asks for headers only, and the grep keeps the status lines and Location headers so you can read the path. In a browser you can use the Redirect Chain Analyzer on DevCraftKit, which analyses what the browser is permitted to observe and can also read pasted curl output in its manual mode. Browsers do not expose every individual hop to web pages, which is why the manual mode exists.

How to fix a chain

  1. List every URL involved and its final destination.
  2. Rewrite each rule so the old URL redirects straight to the final one. Put HTTPS and hostname normalisation in one rule that sets both at once.
  3. Update internal links, sitemaps and canonical tags so they use the final URL and rarely trigger a redirect at all.
  4. Retest from the first URL. You want exactly one redirect, or none for the canonical address.
# One rule that handles both HTTPS and the canonical host in a single hop
RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]
RewriteRule ^ https://www.example.com%{REQUEST_URI} [L,R=301]

That single rule sends any request that is insecure or on the wrong hostname directly to https://www.example.com with the same path. The Apache rewrite rules article explains each part.

Choosing the right status code

Use permanent redirects (301 or 308) for URLs that have moved for good and temporary ones (302 or 307) only when the move really is temporary. The article on 301, 302, 307 and 308 explains the differences.

Prevention

  • Keep a redirect map for each migration and flatten it against earlier ones.
  • Test after every deployment that touches routing, HTTPS or hostnames.
  • Prefer fixing links over adding redirects.

Conclusion

A redirect chain is rarely a bug in one rule; it is an accumulation. Following a URL from start to finish is the only reliable way to see it, and collapsing it to a single hop is a small change that makes pages faster and the site easier to maintain.

Frequently asked questions

What is a redirect chain?
A sequence of two or more redirects between the URL a visitor requested and the page they finally receive, for example http to https, then non-www to www, then a renamed path. A direct redirect has a single hop.
How many redirects is too many?
Aim for one hop from any old URL to its final destination. More than that adds delay for every visitor. Googlebot follows a limited number of hops, so long chains risk the final page not being processed, and browsers stop after roughly twenty.
What is a redirect loop?
A cycle in which URLs redirect to each other and never reach a page, such as A to B and B to A. Browsers show a too-many-redirects error.
Do redirect chains hurt SEO?
They slow users and waste crawling effort, and they make a site harder to maintain, so they are worth fixing. Search engines generally follow short chains and pass signals through permanent redirects, but a direct redirect is more reliable.

The tool that pairs with this guide.

Did this help you untangle your redirects?

If these free developer tools save you time, consider buying me a byte. Your support helps keep DevCraftKit free and growing.

Buy me a byte 💾