WordPress Too Many Redirects – ERR_TOO_MANY_REDIRECTS Fix
The most comprehensive troubleshooting guide from beginner to most-expert level. Master HTTPS redirect loops, Cloudflare settings, .htaccess/Nginx conflicts, WooCommerce issues, and nail every interview question with confidence.
🔍 Understanding Redirect Loops
A redirect loop occurs when a browser receives multiple redirect instructions that eventually point back to a URL it has already visited, creating an infinite cycle. The browser eventually gives up and displays ERR_TOO_MANY_REDIRECTS (Chrome) or The page isn’t redirecting properly (Firefox).
What Happens Behind the Scenes
1. Browser Requests URL
User types https://yoursite.com/shop. The browser sends a GET request to the server.
2. Server Responds with Redirect
Server returns a 301 Moved Permanently or 302 Found status with a Location header pointing to a new URL.
3. Browser Follows Redirect
Browser automatically sends a new request to the URL in the Location header.
4. Server Redirects Again
If the new URL also triggers a redirect back to the original URL (or another URL that eventually loops), the cycle continues.
5. Browser Gives Up
After 10-20 redirects, the browser stops and displays the "Too Many Redirects" error.
Common Redirect Status Codes
| Code | Meaning | Common Use |
|---|---|---|
| 301 | Moved Permanently | SEO-friendly redirects, www to non-www |
| 302 | Found (Temporary) | Temporary maintenance, A/B testing |
| 307 | Temporary Redirect | Preserves HTTP method |
| 308 | Permanent Redirect | Preserves HTTP method, for HTTPS upgrades |
🧠 Root Causes of ERR_TOO_MANY_REDIRECTS
Here's a comprehensive breakdown of every possible cause, organized by category:
| # | Root Cause | Affected Environment | Difficulty to Fix | Likelihood |
|---|---|---|---|---|
| 1 | WordPress Address / Site Address mismatch | All environments | Easy | ⭐⭐⭐⭐⭐ (Most Common) |
| 2 | HTTPS/SSL redirect conflicts | All environments with SSL | Medium | ⭐⭐⭐⭐⭐ |
| 3 | .htaccess redirect loops (www/non-www, multiple rules) | Apache, shared hosting | Medium | ⭐⭐⭐⭐ |
| 4 | Cloudflare SSL/TLS mode misconfiguration | Cloudflare users | Easy | ⭐⭐⭐⭐ |
| 5 | Plugin redirect conflicts | Any WordPress site | Medium | ⭐⭐⭐ |
| 6 | Nginx redirect rule loops | Nginx, VPS | Medium | ⭐⭐⭐ |
| 7 | Browser cache/cookies | All environments | Easy | ⭐⭐⭐ |
| 8 | WooCommerce checkout/account redirect conflicts | WooCommerce sites | Hard | ⭐⭐ |
| 9 | Database options cached | All environments | Medium | ⭐⭐ |
| 10 | Multisite network configuration | WordPress Multisite | Hard | ⭐ |
| 11 | DNS/CDN misconfiguration | CDN users | Medium | ⭐ |
| 12 | PHP session/cookie issues | All environments | Hard | ⭐ |
curl -I to see the redirect chain without browser cache interference.⚡ Quick Fixes – Resolve 80% of Redirect Loops in 5 Minutes
Follow these steps in order. Most users won't need to go beyond step 3.
Step 1: Clear Browser Cache & Cookies
Step 2: Verify WordPress Address & Site Address
Step 3: Check .htaccess for Conflicting Redirect Rules
Step 4: Temporarily Disable All Plugins
Rename the wp-content/plugins folder to plugins_backup via FTP or file manager. If the redirect loop stops, the issue is plugin-related. Re-enable plugins one by one to identify the culprit.
Step 5: Switch to a Default Theme
Some themes (especially those with built-in redirect or SSL options) can cause loops. Switch to Twenty Twenty-Four via Appearance → Themes.
🔒 HTTPS & SSL Configuration – The Most Common Culprit
SSL-related redirect loops happen when your server, WordPress, and CDN (if any) disagree about whether to use HTTP or HTTPS.
Understanding SSL Modes
HTTP Only
No SSL. Site runs on http://. Any HTTPS redirect will loop.
HTTPS Only
Full SSL. Site runs on https://. Any HTTP redirect will loop.
Mixed / Conflicting
WordPress says HTTP, server redirects to HTTPS, but SSL certificate not properly installed.
WordPress HTTPS Configuration
Update the WordPress URLs to use HTTPS:
.htaccess HTTPS Redirect (Correct Way)
Nginx HTTPS Redirect (Correct Way)
🖥️ Apache .htaccess Redirect Loops – Complete Fix
Apache's .htaccess is a frequent source of redirect loops due to conflicting rules or incorrect RewriteCond conditions.
Common .htaccess Redirect Loop Patterns
1. www ↔ non-www Loop
2. HTTPS Loop with Flexible SSL
If using Cloudflare Flexible SSL (where Cloudflare talks HTTPS but origin is HTTP), and your .htaccess also redirects HTTP to HTTPS, you get a loop. The fix is to either:
- Set Cloudflare SSL to Full or Full (Strict) and install a real SSL cert on origin.
- Remove the HTTPS redirect from .htaccess and let Cloudflare handle it.
3. RewriteBase Misconfiguration
Diagnosing .htaccess Loops with curl
🚀 Nginx Redirect Configuration – Avoiding Loops
Nginx doesn't use .htaccess; all redirects are in the server block. Misconfiguration here leads to loops, especially when combining HTTP→HTTPS and www→non-www redirects.
Correct Nginx Redirect Setup (No Loop)
if ($host = www.example.com) inside a location block — it can cause unexpected behavior. Use separate server blocks for clean redirects.Testing Nginx Config Before Reload
☁️ Cloudflare & CDN Redirect Loops – Complete Guide
Cloudflare sits between your visitors and your origin server, and its SSL/TLS settings can inadvertently cause redirect loops.
Cloudflare SSL Modes and Loops
| Cloudflare SSL Mode | Origin SSL Status | Loop Risk | Recommendation |
|---|---|---|---|
| Flexible | No SSL (HTTP) | High if origin redirects HTTP→HTTPS | Only use if origin has no SSL; avoid HTTPS redirect on origin |
| Full | Self-signed or valid SSL | Low | Good if origin has SSL (even self-signed) |
| Full (Strict) | Valid SSL only | Very low | Best practice for production |
| Off | No SSL | N/A | Not recommended for HTTPS sites |
Common Cloudflare Redirect Loop Scenarios
- Flexible SSL + WordPress HTTPS redirect: Cloudflare talks HTTPS to browser, but origin receives HTTP. If origin redirects HTTP→HTTPS, it sends browser back to HTTPS, which Cloudflare again talks HTTPS to origin → loop.
- Cloudflare "Always Use HTTPS" + origin HTTP redirect: Both Cloudflare and origin try to redirect to HTTPS, causing double redirect but usually not a loop. However, if origin also has a redirect back to HTTP (e.g., via plugin), it loops.
- Page Rules misconfiguration: Multiple page rules that redirect to each other.
Fixing Cloudflare Redirect Loops
- Log in to Cloudflare dashboard → SSL/TLS → Overview.
- Set SSL mode to Full (Strict) if you have a valid SSL on origin.
- Check Edge Certificates → Ensure "Always Use HTTPS" is either enabled or disabled consistently with origin redirects.
- Purge cache after changes.
- If using Flexible SSL, disable any HTTP→HTTPS redirect on origin (remove from .htaccess, Nginx, or WordPress plugin).
🛒 WooCommerce & Plugin-Specific Redirect Conflicts
WooCommerce and other plugins can introduce redirect rules that conflict with core settings, especially around checkout, account pages, and SSL.
WooCommerce Redirect Loop Triggers
Checkout HTTPS Enforcement
WooCommerce has a "Force secure checkout" option that redirects checkout to HTTPS. If SSL isn't properly configured, this creates loops.
My Account Redirection
If the My Account page is set incorrectly or has conflicting redirects from plugins like WPML or membership plugins.
SSL Plugin Conflicts
Plugins like "Really Simple SSL" may conflict with server-level redirects, causing loops.
Fixing WooCommerce Redirect Loops
- Go to
WooCommerce → Settings → Advancedand verify the Checkout, Cart, and My Account pages are set to the correct pages. - Disable "Force secure checkout" if you have a global HTTPS redirect already.
- Check for conflicting membership/access control plugins that redirect unauthorized users to login or checkout pages.
- Clear WooCommerce transients:
wp transient delete --all - Regenerate WooCommerce pages:
wp wc pages create --force
Really Simple SSL Loop Fix
💼 Real-World Business Scenarios & Solutions
Interviewers love scenario-based questions. Here are the most commonly asked business scenarios with detailed solutions:
Scenario 1: E-Commerce Site Down After SSL Renewal
ERR_TOO_MANY_REDIRECTS. Revenue is lost every minute.Solution Steps:
- Immediate check: Run
curl -I https://yoursite.comandcurl -I http://yoursite.comto see the redirect chain. - Verify certificate installation:
openssl s_client -connect yoursite.com:443 -servername yoursite.com - Check if HTTPS redirect loop exists: The server may be redirecting HTTPS→HTTP→HTTPS due to mixed content or misconfigured SSL termination.
- Fix: Update .htaccess/Nginx to only redirect HTTP→HTTPS, not the reverse. Ensure WordPress URLs are HTTPS.
- Clear all caches: Including Cloudflare, server cache, and WordPress object cache.
- Monitor: Use uptime monitoring to alert on future loops.
Scenario 2: Cloudflare + WordPress Redirect Loop After Plugin Update
Solution Steps:
- Since admin works, access
wp-adminand deactivate the SSL plugin. - Check Cloudflare SSL mode — if it was "Flexible", the plugin's HTTPS redirects cause loops.
- Set Cloudflare SSL to Full (Strict) and install a valid SSL on origin, or remove the plugin's redirects.
- Purge Cloudflare cache and test.
Scenario 3: Migration from Apache to Nginx Causes Redirect Loop on Checkout
Solution Steps:
- Check Nginx
try_filesdirective — it must route all non-file requests toindex.php. - Check WooCommerce checkout page settings — ensure the page exists and is set.
- Look for
FORCE_SSL_ADMINor plugin-specific redirects that may not work with Nginx headers. - Test with curl:
curl -I -L https://yoursite.com/checkout/and trace the redirect chain.
How AI Tools Help Fix Redirect Loops
AI Log Analyzers
Tools like Elastic AI and Splunk ML scan server logs to identify redirect patterns and detect loops in seconds, showing the exact chain.
Predictive URL Mapping
AI models predict which redirects are unnecessary and suggest consolidation to prevent loops before they happen.
Auto-Configuration Generators
AI like GitHub Copilot can generate correct .htaccess or Nginx redirect rules based on your current setup, avoiding loops.
SEO Impact Analyzers
AI tools assess the SEO damage of redirect loops and prioritize fixes by traffic loss, ensuring you fix the most critical pages first.
AI Prompt Template for Redirect Debugging
Latest AI Tools for Redirect Management (2026)
- Redirect AI by 10Web: Automatically detects and fixes redirect loops on managed WordPress hosting.
- New Relic AI Monitoring: Real-time redirect loop detection with root cause analysis.
- GPT-Engineer: Generate complete server configs with correct redirect rules.
- Screaming Frog AI: Crawls site to find redirect chains and loops, with AI suggestions.
🎤 Interview Questions – All Experience Levels
These are the most frequently asked WordPress redirect loop interview questions, organized by experience level. Click each question to reveal the answer.
📋 Quick Reference Cheat Sheet
Save this for your next redirect loop troubleshooting session or interview:
| Action | Command / Location | When to Use |
|---|---|---|
| Check redirect chain | curl -I -L https://example.com | Identify where loop occurs |
| Update WordPress URLs | wp option update home 'https://example.com' | After SSL migration |
| Check .htaccess | cat .htaccess | Look for conflicting redirects |
| Test Nginx config | nginx -t | Before reload |
| Cloudflare SSL check | Dashboard → SSL/TLS | Rule out CDN loop |
| Disable plugins | Rename plugins folder | Isolate plugin conflict |
| Clear cache | wp cache flush | After any fix |
| Check WooCommerce pages | WooCommerce → Settings → Advanced | Checkout/cart loops |
| Force HTTPS in admin | define('FORCE_SSL_ADMIN', true); | Admin redirect issues |
| Check browser cache | Incognito mode | Rule out local cache |
🎯 Conclusion & Next Steps
Redirect loops (ERR_TOO_MANY_REDIRECTS) are frustrating but solvable. By mastering the concepts in this guide, you'll be able to:
- Diagnose and fix redirect loops in minutes
- Confidently handle HTTPS, Cloudflare, and server-level redirects
- Troubleshoot WooCommerce and plugin-specific conflicts
- Leverage AI tools for faster debugging
- Answer any redirect-related interview question with authority
- Implement preventive measures to avoid future loops
Recommended Next Steps
- Set up a staging environment for testing redirect changes
- Implement automated redirect monitoring (UptimeRobot, Pingdom)
- Create a redirect change checklist for your team
- Practice the interview questions in this guide
- Explore the resources below to continue learning
📚 More Free Resources from FreeLearning365
- Learn Free Programming, Mobile App Dev & IT Skills Online
- 80+ Free Online Tools & Utilities for Developers
- FreeLearning365 eBook Collection
- বাংলাদেশের সর্ববৃহৎ ফ্রি প্রশ্ন ব্যাংক | BCS, HSC, SSC
- AI Background Remover Online Free
- Free Barcode & Label Generator
- Free QR Code Generator
- World-Class AI Prompt Generator (40+ Types)
- Advance Your IT Career with Professional Training in Bangladesh
No comments:
Post a Comment
Thanks for your valuable comment...........
Md. Mominul Islam