What is a redirect loop?
A redirect loop occurs when URL A redirects to URL B, and URL B redirects back to URL A — or through a longer chain that eventually returns to the starting URL. The browser follows the redirects until it hits a limit (usually 20) and displays an error. If you're new to redirects, read our guide to HTTP redirects first.
Common error messages include:
ERR_TOO_MANY_REDIRECTS(Chrome)The page isn't redirecting properly(Firefox)Too many redirects(Safari)
Why redirect loops happen
Redirect loops are almost always caused by conflicting redirect rules. The most common scenarios:
Conflicting .htaccess rules
If you have a rule that redirects /old-page to /new-page, and another rule that redirects /new-page back to /old-page, you have a loop. This happens when two people add rules without checking for conflicts.
HTTP/HTTPS conflicts
A common loop occurs when a server redirects HTTP to HTTPS, but a CDN or load balancer redirects HTTPS back to HTTP. The request bounces between protocols indefinitely.
CMS plugin conflicts
WordPress sites with multiple redirect plugins (or a redirect plugin conflicting with server-level redirects) can create loops. For example, a plugin might add a trailing slash redirect while the server already has one.
CDN and server conflicts
If Cloudflare (or another CDN) has a redirect rule, and your origin server has a conflicting rule, the request may loop between them.
How to find redirect loops
The simplest way to detect a redirect loop is to use the NodSEO Redirect Checker. Enter the URL and trace the full chain. If you see the same URLs appearing multiple times, or the tool reports a loop, you have a problem.
You can also use curl from the command line:
curl -IL https://example.com/pageIf the output shows the same redirect repeated several times before curl gives up, you have a loop.
How to fix redirect loops
The fix depends on the cause. Here's a systematic approach:
Step 1: Check your .htaccess file
Look for conflicting rules. Common patterns to check:
- Multiple
RewriteRuledirectives that affect the same URLs - HTTP and HTTPS redirect rules that conflict
- Trailing slash rules that conflict with explicit redirects
Step 2: Check server configuration
If you're on Nginx, check your server blocks for conflicting return directives. If you're on Apache, check both .htaccess and the main server config.
Step 3: Check CDN rules
If you're using Cloudflare, check your Page Rules and Redirect Rules. Make sure they don't conflict with server-level redirects.
Step 4: Check CMS plugins
If you're on WordPress, disable redirect plugins one by one to identify the conflict. Use only one redirect management method — either server-level or plugin-level, not both.
Step 5: Verify the fix
After making changes, use the Redirect Checker again to confirm the loop is resolved. The redirect chain should be clean — ideally one hop from the original URL to the final destination.
Preventing redirect loops
Prevention is better than debugging:
- Document your redirects. Keep a spreadsheet of all redirect rules so you can check for conflicts before adding new ones.
- Use one redirect method. Either use server-level redirects (.htaccess, Nginx) or a CMS plugin — not both.
- Test before deploying. Always test redirect rules in a staging environment before pushing to production.
- Audit regularly. Use the Redirect Checker to scan for chains and loops periodically.