Skip to content

Redirect chains and redirect loops

Every extra redirect hop costs time, and a loop makes a page completely unreachable. Here is how chains and loops arise, how to find them and how to get rid of them.

What is a redirect chain?

A redirect chain is a sequence of two or more redirects between the requested URL and the final page. Instead of going from A straight to the destination, the client is sent from A to B, from B to C and only then gets content:

http://example.com/shop
  301 → https://example.com/shop
  301 → https://www.example.com/shop
  301 → https://www.example.com/shop/
  200 OK

Each of these redirects is correct on its own. Together, they make every visitor and every crawler take three extra round trips.

A redirect loop is a chain without an end: a URL redirects, directly or through intermediate steps, back to itself.

https://example.com/
  301 → https://www.example.com/
  301 → https://example.com/
  301 → https://www.example.com/
  ...

A browser gives up after a fixed number of redirects (20 in Chrome and Firefox) and shows an error such as ERR_TOO_MANY_REDIRECTS in Chrome or "The page isn't redirecting properly" in Firefox. The page is unreachable for everyone.

Why chains hurt

  • Latency: every hop is a complete HTTP request and response. If the hostname changes, the browser may also need a new DNS lookup, TCP connection and TLS handshake. On mobile networks, each hop can easily add a noticeable delay before the first byte of the real page arrives.
  • Crawl budget: Googlebot has to request every intermediate URL. On large sites, crawl capacity spent on redirect hops is not spent on new or updated content.
  • Hard limits: Google follows up to 10 hops. If it does not reach content within those, Search Console reports a redirect error and the URL is not indexed. Other crawlers, link preview bots and HTTP clients often give up much earlier.
  • Fragility: the longer the chain, the more places where something can break. One expired certificate or one deleted rule in the middle and the whole chain fails.

What chains do not do: according to Google, permanent and temporary redirects pass PageRank, so a short chain does not "leak" link equity per hop. The problem is speed, crawling and reliability. Still, keeping every redirect to a single hop is the goal.

How chains arise

Almost nobody builds chains on purpose. They grow over time:

  • Separate normalization rules: one rule for HTTP to HTTPS, one for www, one for trailing slashes, each applied in turn. The fix is shown in HTTP to HTTPS and the www redirect guide.
  • Successive relaunches: in 2019, /products.html was redirected to /products/. In 2023, /products/ moved to /shop/. Nobody updated the first redirect.
  • Domain migrations: the old domain redirects to the same path on the new domain, and the new domain then redirects that path again. See the domain migration checklist.
  • Multiple layers: the CDN, the web server, the application and a CMS plugin each add their own redirects.
  • Internal links to old URLs: navigation, sitemaps or canonical tags point to URLs that redirect, so the chain begins with your own site.
  • Tracking and shortener URLs in front of an already redirected landing page.

Common causes of redirect loops and ERR_TOO_MANY_REDIRECTS

CauseWhat happensFix
TLS terminated at a proxy or CDN (e.g. Cloudflare "Flexible")The origin sees every request as HTTP and redirects to HTTPS; the proxy fetches HTTP againUse Cloudflare "Full (strict)" or check X-Forwarded-Proto instead of the connection protocol
Contradicting host rulesServer forces www, CMS or CDN forces non-wwwPick one preferred host and enforce it in exactly one place
Wrong CMS URLWordPress site URL says http:// while the server forces HTTPS, or vice versaSet the site URL to the final HTTPS URL
Trailing slash conflictOne rule adds a slash, another removes itDecide on one convention and remove the opposite rule
Redirect rule matches its own target/shop redirects to /shop/, and a pattern like ^shop matches the target againAnchor patterns with ^ and $, add conditions
Cookie or login based redirectsLogin page redirects to the dashboard, the dashboard back to login because a cookie is not setCheck cookie domain, Secure flag and path; clear cookies to test
Language or geo redirectsTwo locale detection rules send users back and forthRedirect only from a neutral URL, never between language versions

A classic example of a self-matching rule in Apache:

# Wrong: also matches /new-shop/ and redirects it again
RewriteRule shop https://example.com/new-shop/ [L,R=301]

# Right: only matches exactly /shop or /shop/
RewriteRule ^shop/?$ https://example.com/new-shop/ [L,R=301]

Platform-specific loops and their fixes are covered in the guides for Cloudflare, WordPress and .htaccess.

How to find chains and loops

  1. Single URLs: enter the URL in the redirect checker. It lists every hop with status code, target and timing and flags loops. Test all variants: http://, https://, with and without www, with and without a trailing slash.
  2. Lists of URLs: paste old URLs, backlink targets or your redirect map into the bulk checker and sort by the number of hops.
  3. Whole sites: a desktop crawler such as Screaming Frog or a site audit tool finds internal links that point to redirects and reports chains across the site.
  4. Search Console: the page indexing report lists URLs with "Redirect error". These are usually loops, chains that are too long, or redirects to invalid URLs.
  5. Command line: for a quick check, curl shows each hop:
    curl -sIL http://example.com/shop | grep -iE '^(HTTP|location)'

How to fix redirect chains

  1. Point every source straight to the final URL. Go through your redirect rules and replace every target that itself redirects with the final destination. In a redirect map: if B → C exists, change A → B to A → C.
  2. Combine normalization rules. Protocol, host and trailing slash should be fixed in one redirect. For example in nginx:
    server {
        listen 80;
        listen [::]:80;
        server_name example.com www.example.com;
        return 301 https://www.example.com$request_uri;
    }
  3. Enforce each rule in one place only. Either the CDN, the server or the application, not all three.
  4. Update internal links, canonical tags and sitemaps so they point to final URLs. Your own site should never trigger a redirect.
  5. Keep the old redirects. Do not delete intermediate redirects, just change their targets. External links may still point to any URL in the chain.
  6. Test again with the redirect checker: each variant should need exactly one hop to reach a 200.

A single hop is the goal. For more on choosing the right status code for that hop, see 301 vs. 302.

Frequently asked questions

How many redirects in a chain are too many?

Googlebot follows up to 10 hops, browsers stop at 20. But the goal should always be one hop. Every additional one adds latency and crawl effort, so fix any chain with two or more redirects when you find it.

Do redirect chains lose PageRank?

According to Google, 301, 302, 303, 307 and 308 redirects all pass PageRank. The real costs of chains are slower loading, wasted crawl budget and the risk of hitting the 10-hop limit or a broken link in the middle.

How do I fix ERR_TOO_MANY_REDIRECTS?

First, clear the site's cookies to rule out a cookie-based loop. Then check the URL in the redirect checker to see which URLs alternate. The usual culprits are Cloudflare's "Flexible" SSL mode, a CMS site URL that does not match your server rules, or conflicting www or trailing slash rules.

Should I delete old redirects to shorten chains?

No. Change their target to the final URL instead. Backlinks and bookmarks may point to any URL in the chain, and deleting a redirect turns those links into 404s.

  • Redirect HTTP to HTTPS

    Every HTTP URL on your site should end up on its HTTPS version in exactly one permanent redirect. Here is how to set that up, secure it with HSTS and verify the result.

  • www to non-www redirect (and vice versa)

    www.example.com and example.com are two different hosts. Pick one, redirect the other to it permanently and make sure everything else on your site agrees.

  • Domain migration checklist

    Moving a website to a new domain is manageable if every old URL redirects to its exact counterpart. This checklist walks you through before, during and after the move.