The fix, in one snippet
return 301 https://www.example.com$request_uri;
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
The crawler follows redirects one hop at a time and records the full chain for each URL: every intermediate address and its status code. This check reports any URL that needed two or more hops to resolve.
A single redirect is normal and is not reported. Two or more is a chain, and the evidence shows each step so the shortcut is obvious.
Why it matters
Each hop is a full request: DNS, connection, TLS handshake, response. On a mobile connection a two-hop chain can add half a second before the first byte of real content arrives.
Search engines follow a limited number of hops, and although the modern limit is generous, signals weaken along a chain and Google's own guidance is to keep chains to one hop. Long chains also make debugging harder: when something breaks in the middle, the symptom appears on a URL that has nothing obviously wrong with it.
Chains accumulate. A site moves to HTTPS, then to a new domain, then restructures its URLs, and each migration adds a hop to rules nobody revisits.
How to fix it
Collapse each chain so the first URL redirects straight to the final destination. Rewrite the rules rather than adding another one on top:
# before: three hops
http://example.com/old -> https://example.com/old
-> https://www.example.com/old
-> https://www.example.com/new
# after: one hop, and canonical host and scheme applied together
return 301 https://www.example.com/new;
Put the scheme and host canonicalisation in a single rule at the edge, and keep path-level redirects in one table that is reviewed at each migration. Then update the internal links that still point at the old URL: a redirect is a safety net, not a substitute for a correct link.
Where this fits
Redirect chains is check 7 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 Linked pages blocked by robots.txt (medium), where a page you link to internally but disallow in robots.txt sends contradictory signals and wastes the link. 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 chains closes one route in. Immediately below it: Sitemap URLs are live and indexable, where every URL in a sitemap is a claim that the page exists and should be indexed; XML sitemap published and declared, where an XML sitemap lists the URLs you want crawled and when they last changed; robots.txt present and usable, where robots.txt is the first file a crawler asks for.
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 chains (medium severity)
Scanner check id: seo-redirect-chains
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.