SiteCheck (opens in a new tab) 4 min read
How to find and fix redirect chains and loops
A redirect chain sends visitors through extra hops before a page loads. A loop never loads. Crawl the site to list both, then point each URL at its final target.
A redirect is fine. A redirect to a redirect is a chain. A redirect that eventually arrives back where it started is a loop. Chains are slow and waste crawl budget. Loops are a dead page with a browser error on it. Both are easy to list with a crawl and dull to fix by hand, which is why they accumulate.
How chains happen
Nobody writes a chain on purpose. They are layered:
http://example.com/page→https://example.com/page(the HTTPS rule)https://example.com/page→https://www.example.com/page(the host rule)https://www.example.com/page→https://www.example.com/page/(the trailing-slash rule)https://www.example.com/page/→https://www.example.com/new-page/(last year's migration)
Each rule is correct on its own. A visitor who typed the first URL makes four round trips before any HTML arrives. A crawler following an old backlink does the same, and search engines give up on long chains.
Loops are usually two rules that disagree: one layer adds a trailing slash, another removes it. Or a CMS redirects a deleted page to a category, and the category page redirects to the deleted page because an editor set it up months earlier.
Find them
You cannot see a chain in a browser. The address bar shows the end. You need something that records every hop.
Run a SiteCheck (opens in a new tab) inspection on the public URL. The report lists redirect chains and loops alongside broken links, HTTP errors, titles, robots.txt, sitemap, TLS, mixed content, noindex, and canonicals. Free: a one-off scan of up to 25 pages, no account, no card. Starter ($9/month or $90/year) re-scans one site weekly; Pro ($19/month or $190/year) covers five sites daily. What else the report includes is in what a website health report covers.
If you only want to check a single URL by hand, a command-line fetch that follows redirects and prints each status will show the hops:
curl -sIL -o /dev/null -w '%{http_code} %{url_effective}\n' https://example.com/page
That is fine for one URL. A site has hundreds. Use the crawl for the list, and the single fetch to confirm a fix.
Fix them
The rule is one hop: every URL that redirects should point at the final destination, not at the next step.
- Collapse the host and scheme rules. Send
http://, and whichever ofwwwor apex you are not using, straight to the canonicalhttps://host/in one redirect. Most servers and proxies can do scheme and host in a single rule. - Pick one trailing-slash policy and apply it in the same layer as the host rule, so it does not become a second hop.
- Rewrite old migration redirects to the current target. If
/old→/mid→/new, change the first rule to/old→/newand keep/mid→/new. - Break loops by deciding where the URL should land, then deleting the rule that points the other way. Two layers that both touch the same path (a proxy and a CMS plugin, for example) are the usual cause.
- Update internal links so they point at the final URL directly. A redirect that no page on your site uses is cheap. A redirect in your own navigation is a hop you pay on every click.
Use a 301 for a permanent move. A 302 tells crawlers the move is temporary and they should keep the old URL.
Confirm
Re-run the inspection. The redirect section should list single hops or nothing. Check a few URLs with the single fetch above and read the status line for each hop.
Keep it from coming back
Redirect rules accumulate at every migration, redesign, and host change. Two habits help:
- Re-scan after any change to the proxy, the CMS, or the DNS. SiteCheck's paid plans do this weekly or daily; the free scan is enough for a one-off.
- Baseline the links in Mortise (opens in a new tab) once the site is clean. A redirect whose target loads is a success for the visitor. A redirect whose target later returns 404 or 410 is the break Mortise alerts on, after a link that worked fails twice. That catches the migration redirect whose destination was deleted months later. The setup is in how to find newly broken links after a website migration.
Redirects are also on the pre-launch list in the website launch checklist.
Checklist
- Every redirecting URL on the site resolves in one hop.
- Scheme, host, and trailing slash are handled in one layer, one rule.
- Old migration redirects point at today's target, not last year's.
- No two layers redirect the same path in opposite directions.
- Internal links point at final URLs.
- Permanent moves use 301.