Too many redirects: how to find and fix a redirect loop

Short answer

A redirect loop means URL A sends the browser to URL B, and B sends it back, so the page never loads. On your own site, it's usually two rules disagreeing about HTTP vs HTTPS, www vs non-www, or a trailing slash. Trace the hops with curl, then remove one of the two rules.

Seeing this on someone else's site? Clear that site's cookies or try a private window. If that doesn't help, the problem is probably on their side. The rest of this guide is for people who run the site.

What the error means

Each redirect tells the browser to try another URL. If that URL redirects too, the browser follows it, and eventually gives up. Chrome shows This page isn't working and redirected you too many times with the code ERR_TOO_MANY_REDIRECTS. Other browsers word it differently.

It often appears straight after a change, such as turning on HTTPS, adding a CDN, moving domain or installing a redirect plugin. Start by asking what changed.

The usual causes

CauseWhat happens
CDN and server disagree on HTTPSThe CDN talks to your server over HTTP, the server redirects to HTTPS, and the CDN asks over HTTP again.
www and non-www rules clashOne layer sends visitors to www and another sends them back.
Trailing slash rules clashThe app adds a slash and the server or CDN removes it.
Wrong site address in the CMSThe CMS redirects to the address it has stored, which then redirects somewhere else.
A redirect points at itselfA rule's pattern also matches its own target, so it keeps firing.
A sign-in or consent redirectThe page redirects until a cookie is set, but the cookie never sticks. This can affect only some visitors.

How to trace the loop

1Use curl 1 minute

This prints the status and destination of each hop, and stops after 10:

curl -sIL --max-redirs 10 https://example.com/page | grep -iE '^(HTTP|location)'

Look for the URL that repeats. The two addresses it alternates between show you which two rules are fighting.

2Use the browser 2 minutes

Open DevTools (F12), go to the Network tab, tick Preserve log and load the page. Each request shows its status and Location header. Use this when the loop depends on cookies, as curl doesn't send your session.

3Compare the layers 5 minutes

A redirect can come from the CDN, the server, the app or a plugin. If the response headers show your CDN handled it, look there first, then work back towards the app.

How to fix it

Pick one place to own each rule, and remove the duplicate from the others.

  • Cloudflare: a common cause is Flexible SSL with an origin that forces HTTPS. Cloudflare's advice is to remove the origin's redirect, or move to Full or Full (strict), which needs a certificate on your server. Then check redirect rules for conflicts.
  • WordPress: check that WordPress Address (URL) and Site Address (URL) in Settings > General match the address you want. If the admin won't load, WP_HOME and WP_SITEURL in wp-config.php override them. Then disable redirect, security and caching plugins one at a time.
  • Apache or Nginx: make the condition exclude its own target, so the rule can't match the URL it sends visitors to.
  • Next.js: check redirects() in next.config.js. Its docs warn that a missing / before a path parameter can cause infinite redirects.

Test in a private window afterwards, as browsers can cache permanent redirects. HSTS can also force HTTPS in a browser that's already seen it, so check the header if HTTP keeps turning into HTTPS. Choosing the right status for the rule you keep? See 301 vs 302 redirects.

If Googlebot hits the loop, it can't reach the page. Search Console's Page indexing report lists these as Redirect error, which covers a chain that's too long, a loop, a URL that grew past the length limit, and a bad or empty URL in the chain.

Google generally follows up to 10 hops, so a long chain can fail without being a true loop. After the fix, use Validate fix in the report and URL Inspection to confirm a few pages.

How crawlers report this

Screaming FrogSitebulbWhat it means
Response Codes: Internal Redirect LoopInternal URL is part of a chained redirect loopA series of URLs loops back on itself.
No direct matchInternal URL redirects back to itselfA URL redirects straight to itself.
Response Codes: Internal Redirect ChainNo direct matchA URL goes through several redirects before it lands.
No direct matchInternal redirects from trailing slash mismatchLinks use the version of the URL that redirects.

Checking a page's links?

Spot links that fail or redirect

SEOSnip's link checker tests up to 100 of a page's links, plus its canonical and hreflang targets:

  • Links that fail, including ones that never load because they loop
  • Internal links that redirect, with the final URL to use instead
  • Canonical and hreflang targets that redirect or fail
  • A ticket with that evidence, and Check if fixed to run it again

A looping link shows as no response, not as a list of hops, so use curl to see the loop itself.