How to Fix Redirect Loops (ERR_TOO_MANY_REDIRECTS)
A redirect loop happens when a URL redirects to another URL that eventually redirects back to the first one, so the browser never reaches a page and shows ERR_TOO_MANY_REDIRECTS. By the end of this guide you will have traced every looping URL, found the conflicting rules (usually HTTPS, www or trailing-slash logic set in two places), consolidated them into a single source of truth and confirmed each URL now resolves to a 200 response.

Why it matters
A looping URL is effectively a dead page. Googlebot stops following after about 10 hops and drops the URL from the index, AI crawlers and link previews get nothing to read, and visitors see a browser error instead of your content. Loops often hit the whole site at once (for example after an SSL or CDN change), so a single misconfiguration can take every page out of search and break checkout or sign-in flows.
This audit fails if even one crawled URL loops.
What you need
Step-by-step fix
Trace the redirect chain for each flagged URL
Run curl against every URL the audit flagged and read the Location header of each hop. A loop shows the same two or three URLs repeating until curl gives up. Note exactly what changes between hops: the scheme (http/https), the host (www/non-www), a trailing slash, letter case, or a query parameter.
That difference tells you which rules are fighting.
curl -sIL --max-redirs 10 https://example.com/pricing | grep -iE '^(HTTP|location|server|cf-ray)'
Identify which layer issues each redirect
Redirects can come from several layers, and loops usually mean two of them disagree. Check response headers to see who answered: server: cloudflare or a cf-ray header means the CDN; x-redirect-by: WordPress or a plugin name means the CMS; a plain server: nginx or Apache with no app headers usually means server config. List every place a redirect can be defined:
- CDN: Cloudflare Redirect Rules, Page Rules, Always Use HTTPS
- Hosting panel: force HTTPS / force www toggles
- Server: .htaccess, Nginx
return/rewrite - CMS or framework: site URL settings, redirect plugins, middleware
Fix HTTPS loops caused by a proxy or CDN
The most common loop: the CDN talks to your origin over HTTP, the origin forces HTTPS, and the CDN forwards the request over HTTP again. In Cloudflare set SSL/TLS > Overview to Full (strict) (not Flexible) and install a valid certificate on the origin. If your app sits behind a load balancer, make it trust the X-Forwarded-Proto header so it knows the visitor is already on HTTPS.
# .htaccess: only redirect when neither the connection nor the proxy reports HTTPS
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^ https://example.com%{REQUEST_URI} [L,R=301]Define the canonical host and scheme in one place
com` without www) and enforce it in a single layer, ideally the web server or CDN. g. "Force www") must be turned off.
Two rules pointing at different canonical hosts is a guaranteed loop.
server {
listen 80;
listen 443 ssl;
server_name www.example.com;
return 301 https://example.com$request_uri;
}
server {
listen 80;
server_name example.com;
return 301 https://example.com$request_uri;
}
server {
listen 443 ssl;
server_name example.com;
# site config here, no host/scheme redirects
}Resolve trailing-slash and case conflicts
If hops alternate between /pricing and /pricing/, one rule adds the slash and another removes it. Pick one convention and remove the opposing rule. js trailingSlash, WordPress permalink structure ending in /) combined with a server or CDN rule doing the reverse.
Do the same for lowercase-forcing rules that clash with case-sensitive CMS routes.
# Nginx: add a trailing slash only for paths without a file extension rewrite ^([^.]*[^/])$ $1/ permanent;
Remove circular rules in redirect managers
Open your redirect list and search for each looping path as both a source and a target. Delete or edit any pair where A redirects to B and B redirects back to A, and any chain that returns to its starting point (A → B → C → A). Also check that the destination page actually exists and is published; a CMS may redirect an unpublished slug back to an old URL that you have redirected forward.
Purge caches and retest every flagged URL
Browsers and CDNs cache 301 responses, so a fixed loop can still appear. Purge the CDN (Cloudflare: Caching > Configuration > Purge Everything), clear any page-cache plugin and server cache, then re-run curl on each URL from the audit plus its http and www variants. Each should end in a 200 after at most one redirect.
Finally, rerun the site audit to confirm zero looping pages.
for u in https://example.com/pricing http://example.com/pricing https://www.example.com/pricing; do echo "== $u"; curl -sIL --max-redirs 10 -o /dev/null -w '%{http_code} %{num_redirects} %{url_effective}\n' "$u"; donePlatform-specific notes
WordPress
Make sure Settings > General > WordPress Address (URL) and Site Address (URL) use the same scheme and host as your server/CDN rules. Check redirect plugins (Redirection: Tools > Redirection; Rank Math: Rank Math > Redirections; Yoast Premium: Yoast SEO > Redirects) for circular entries. If locked out, set WP_HOME and WP_SITEURL in wp-config.php.
Cloudflare
Use SSL/TLS mode Full (strict); Flexible is the classic loop cause when the origin also forces HTTPS. Review Rules > Redirect Rules, Bulk Redirects and any legacy Page Rules for conflicts with server redirects, and avoid enabling Always Use HTTPS while the origin redirects HTTPS to HTTP.
Shopify
Shopify manages HTTPS and the primary domain itself (Settings > Domains). Loops usually come from URL redirects in Online Store > Navigation > View URL redirects (in newer admins under Content > Menus) where a redirect's source is a URL that still exists or targets another redirected path. Delete the conflicting entry; note Shopify only applies redirects for paths that return 404.
Next.js / Vercel
Check redirects() in next.config.js, middleware.ts, and the trailingSlash option together; a middleware that adds a slash while trailingSlash: false removes it will loop. On Vercel, also check the domain settings: if both the www and apex domain are set to redirect to each other under Project > Settings > Domains, you get a loop.
Wix / Squarespace
HTTPS and primary domain are handled by the platform. Loops come from the URL Redirect Manager (Wix: Settings > SEO > URL Redirect Manager; Squarespace: Settings > Developer Tools > URL Mappings) or from a DNS/CDN layer in front of the site forcing a different host than the one set as primary.
Check that it worked
✅ How to verify
- Run curl -sIL on each previously flagged URL and its http/www variants: every one ends in HTTP 200 with no more than one redirect.
- Open the URLs in a private browser window with DevTools > Network ('Preserve log' on) and confirm there is no repeating sequence of 301/302 responses.
- Use Google Search Console URL Inspection > Test Live URL on a key page; it should report the page as fetchable, not a 'Redirect error'.
- Rerun the site audit and confirm the Redirect loops check reports zero looping pages.
⚠️ Common mistakes
- Using Cloudflare Flexible SSL while the origin server or CMS also forces HTTPS.
- Enforcing www/non-www or HTTPS in two places (hosting panel plus .htaccess or CDN) with opposite targets.
- Testing only in a normal browser tab, where a cached 301 makes a fixed URL still appear to loop, or a cached 200 hides a loop that crawlers still hit.
- Fixing one hop but leaving a multi-step chain (A → B → C → A) because only direct A ↔ B pairs were checked.
Is this still an issue on your site? Run a free audit — ZORO checks this and 294 other SEO, AI-visibility, accessibility and security signals, with fixes for your platform.
Check my site freeFAQ
What causes ERR_TOO_MANY_REDIRECTS?
Two or more redirect rules that disagree about the final URL, so each sends the request back to the other. The usual pairs are HTTP vs HTTPS (often a CDN in Flexible SSL mode), www vs non-www, and trailing slash vs no slash, or a redirect plugin entry that points back to its own source.
How many redirects will Google follow before giving up?
Googlebot follows up to 10 redirect hops and then reports a redirect error. A loop never resolves, so the URL is not indexed. Aim for zero or one hop from any internal link to its final URL.
Why does clearing cookies sometimes fix a redirect loop?
Some loops depend on cookies, such as language, region, login or consent redirects that set a cookie and redirect based on it. If clearing cookies fixes it for you, the server logic is still broken for crawlers, which never keep cookies. Make these redirects work without a cookie or remove them for bots.
Can a redirect loop affect my whole site?
Yes. If the loop comes from a host, HTTPS or trailing-slash rule, every URL inherits it and the entire site becomes unreachable. That is why loops often appear right after enabling a CDN, changing SSL settings or switching the primary domain.
How to Fix 302 Redirects Used for Permanent Moves
How to Fix Redirect Chains and Collapse Them to One 301
How to Fix Soft 404 Pages and Return a Real 404 Status
How to Fix Server Errors (5xx) Found in Your Site Audit
How to Fix a Missing or Unhelpful Custom 404 Page
How to Fix Broken Internal Links That Return 4xx Errors