The fix, in one snippet
curl -sIL https://example.com/page | grep -iE '^(HTTP/|location)'
Illustrative values. Change the paths, hostnames and options to match your own site before using it.
The sections below explain what is tested, why it matters and the alternatives.
What we test
We record the full redirect chain for every URL and check whether any address appears in it twice. A repeat means the chain cannot terminate: the browser gives up with an error, and the crawler drops the URL.
Why it matters
A loop is a total outage for that URL. Browsers show "too many redirects" and nothing else; there is no partial degradation and no cached fallback.
The common causes are pairs of rules that each look correct alone: a rule forcing www next to one stripping it, an HTTPS redirect at the CDN with an HTTP redirect at the origin, or a locale detector that redirects to a locale which redirects back. Because each rule is right in isolation, the fault survives review.
Search engines eventually remove looping URLs from the index, and any external links to them are wasted.
How to fix it
Reproduce the loop and read the chain, which usually names the two rules fighting each other:
curl -sIL https://example.com/page | grep -iE '^(HTTP/|location)'
Then apply canonicalisation in exactly one place. Decide the host and scheme once, at the outermost layer, and remove the equivalent rules from the layers beneath it. If a CDN forces HTTPS, the origin must not also redirect, because the origin only ever sees the CDN's request and cannot tell what the visitor asked for. Where the origin has to know, read X-Forwarded-Proto rather than the connection scheme.
Where this fits
Redirect loops is check 3 of 10 that the seo & site health audit runs under indexing and crawlability, ordered the way they are worth fixing. That ordering is the point: Fixing this one while the check above it still fails buys less than it looks like.
Fix this one first
Above it in the same category sits Pages excluded with noindex (high), where a noindex directive removes a page from search results entirely. An attacker who has that does not need this, so it is the better use of the same hour.
What fixing this still leaves open
Redirect loops closes one route in. Immediately below it: Canonical URL missing, where a canonical link tells search engines which URL is the real one when the same content is reachable at several addresses; Canonical points to another URL, where a canonical pointing at a different URL asks search engines to index that URL instead of this one; Linked pages blocked by robots.txt, where a page you link to internally but disallow in robots.txt sends contradictory signals and wastes the link.
Found in the same scan
The seo & site health audit reports this alongside checks from other categories that are at least as serious, including Broken internal links, where an internal link that returns an error is a dead end for the reader and a wasted request for the crawler, and Duplicate body content, where two pages with identical body text are one page at two addresses, and search engines will pick one of them for you. A single run of seo & site health audit answers all of them at once.
The first few lines
You are a senior web engineer. I ran a security and SEO scanner against my site and it reported the finding below. Fix it properly rather than suppressing the symptom.
Finding: Redirect loops (high severity)
Scanner check id: seo-redirect-loops
The rest of this prompt names the pages and line numbers we found the problem on, the configuration to change, and the constraints a good answer has to respect. It is free, it just needs an account so the work is not scraped wholesale.
Sign in with GoogleSigning in is free and takes one click. We store your email address and nothing else.