Infinite Redirect Loops: What They Are and How to Fix Them Fast
"This page isn't working. Too many redirects." If you're seeing this error, your site is stuck in an infinite loop—and every second counts.
Few things are more frustrating than watching your browser spin endlessly, trying to load a page that will never load. Infinite redirect loops make your site completely inaccessible. Worse, users can't reach your content, and search engines penalize sites with redirect problems.
Business Impact
A redirect loop doesn't just annoy users—it kills your business. Zero page views, zero conversions, and Google stops crawling your site entirely. Fix this immediately.
What Is a Redirect Loop?
A redirect loop happens when Page A redirects to Page B, which redirects back to Page A. Or when Page A redirects to itself. Browsers detect this circular pattern and stop trying after 20-30 redirects, showing the dreaded "too many redirects" error.
Example redirect loop:
yourdomain.com → www.yourdomain.com
www.yourdomain.com → yourdomain.com
yourdomain.com → www.yourdomain.com
[infinite loop continues...]Common Causes
1. Conflicting .htaccess Rules
The most common culprit. You have multiple redirect rules that contradict each other. For example, one rule forces www while another forces non-www.
# Bad: Conflicting rules
RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [R=301,L]
RewriteRule ^(.*)$ https://yourdomain.com/$1 [R=301,L]2. Plugin or CMS Conflicts
WordPress plugins, caching plugins, or security plugins often add their own redirect rules. When these conflict with server-level redirects, loops happen.
3. Incorrect SSL/HTTPS Configuration
Your server tries to force HTTPS, but your application also forces HTTPS, creating a redirect loop between HTTP and HTTPS versions.
4. Cloudflare or CDN Settings
Cloudflare's SSL mode set to "Flexible" while your server forces HTTPS can create infinite loops. The traffic bounces between Cloudflare and your server endlessly.
How to Diagnose Redirect Loops
Use a Redirect Checker Tool
Manual testing is nearly impossible—you can't see what's happening fast enough. Use our Redirect Checker to trace the entire redirect chain instantly.
Trace Your Redirects
See every step in your redirect chain and identify exactly where the loop starts.
Check Redirects NowOur tool shows you each redirect, the status code (301, 302, 307), and where it's going. This makes identifying loops trivial—you'll see the same URL appear multiple times.
Step-by-Step Fixes
Fix 1: Check .htaccess (Apache)
Look for conflicting RewriteRule directives. Make sure you have only ONE rule for www vs non-www, and ONE rule for HTTPS:
# Good: Force HTTPS and non-www
RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [L,R=301]Fix 2: Clear Cookies and Cache
Sometimes cookies or cache cause redirect loops. Clear them completely:
- Clear browser cache and cookies
- Try incognito/private mode
- Test from a different browser or device
Fix 3: Check Cloudflare SSL Settings
If using Cloudflare, set SSL mode to "Full" or "Full (Strict)", not "Flexible":
- Log into Cloudflare dashboard
- Go to SSL/TLS settings
- Change mode from "Flexible" to "Full"
- Wait 5 minutes for changes to propagate
Fix 4: Disable Plugins (WordPress)
Temporarily disable all plugins, especially redirect, caching, and security plugins. Test if the loop disappears. Re-enable plugins one by one to identify the culprit.
Fix 5: Check Application Code
Search your codebase for redirect functions. Common culprits:
# PHP
header('Location: ...');
# JavaScript
window.location = '...';
window.location.replace('...');
# Node.js
res.redirect('...');Preventing Future Loops
- Test before deploying: Always test redirect changes on staging first
- Document your redirects: Keep a list of all active redirect rules
- Use monitoring: Set up alerts with our Website Monitor to catch loops immediately
- Audit regularly: Use our Redirect Checker monthly to verify everything works
Redirect Chains vs Loops
A redirect chain is different from a loop. Chains are sequential (A→B→C→D) but eventually reach a final destination. Loops never end. Both hurt SEO, but loops break your site entirely.
Aim for zero redirect chains. If you must redirect, do it in one step (A→D directly), not through intermediaries. Learn more in our guide on redirect chains and SEO impact.
Conclusion
Infinite redirect loops are serious but fixable. Use proper tools to diagnose the problem quickly—manually tracing redirects is inefficient and error-prone. Our Redirect Checker shows you the entire chain instantly, helping you identify and fix loops in minutes instead of hours.
Fix Your Redirects Now
Trace your redirect chain and identify loops in seconds with our free redirect checker tool.
Check Your Redirects