Netlify
Netlify redirect chains: _redirects and primary domain
Netlify redirects apex to www or the reverse automatically, and your _redirects rules add hops on top. The exact mechanisms and the loop trap.
Netlify automatically sends alternate domains to the primary domain, while rules in "_redirects" or netlify.toml can add another hop or loop. Confirm the primary domain, read the redirect rules in first-match order, remove any rule that duplicates host normalization, redeploy, and test the complete path from the old URL.
Why Netlify does this
Two layers exist. The platform layer: "If you set the www subdomain as your primary domain, Netlify will automatically redirect the apex domain to the www subdomain. If you set the apex domain as your primary domain, Netlify will automatically redirect the www subdomain to the apex domain." The rules layer: redirects live "in two ways", a _redirects file in the publish directory or redirects tables in netlify.toml, with 301 the default status, processed top to bottom: "Rules in the _redirects file are always processed first, followed by rules in the Netlify configuration file." Their docs warn about self-defeating rules with the example of redirecting "/blog/remove-my-slashes/" to "/blog/remove-my-slashes" on a 301 with the force option, which "will cause an infinite redirect because the paths are effectively the same", and the domain-level redirects section notes that "http and https need separate rules" unless their force_ssl option is in play.
Check it right now
Before changing anything, confirm what a crawler actually sees. The check is free, takes one URL and needs no account.
How to fix it
- Open Domain management > Production domains and confirm which domain is the primary; the other is redirected automatically.
- Read the _redirects file and any netlify.toml redirects tables top to bottom: the first matching rule wins.
- Look for rules that redirect to a domain the primary-domain setting also redirects, and collapse them into one hop.
- Check for a rule whose from and to are the same path after trailing-slash normalization; their docs' example causes an infinite redirect.
- Deploy, then re-check the URL with the free redirect checker below and count the hops.
Why it happens again
The automatic apex and www redirect is set once in the dashboard and never appears in the repository, while the _redirects file is edited on every redesign. Rules accumulate in file order, the engine stops at the first match, and nobody re-counts the hops after adding one. Their docs carry the infinite-redirect example precisely because rules that look different can be, in their words, "effectively the same".
stillindexed re-checks the URLs you give it every 30 minutes on Starter and alerts when a directive changes, at most 30 minutes after it does. It is a monitor rather than a crawler: it watches a list you choose and tells you when one of seven things changes. Card first, no trial, and a 30 day refund.
Catching it next time
Fixing it once is the easy half. The setting that caused this can be changed again by anyone with access, and the page will keep returning 200 while it happens.
Other ways Netlify loses pages
A broken or chained redirect, on other platforms
Sources
Every claim about Netlify above is from their own documentation, read on 2026-08-30. Platforms change their settings; if one of these is out of date, their page wins and we would like to know.