WordPress Errors 8 min read

How to Fix "ERR_TOO_MANY_REDIRECTS" in WordPress: Complete Troubleshooting

Advertisement

Google AdSense In-Article Display Placement

Publisher ID: ca-pub-XXXXXXXXXXXXXXXX (Configured in config.php)

The browser error "ERR_TOO_MANY_REDIRECTS" occurs when page A points to page B and page B points back to page A in an infinite loop. In WordPress, this is caused by mismatched site URLs, conflicting SSL redirects, or Cloudflare Flexible SSL.

✔ Rapid Direct Solution

1) Open wp-config.php and hardcode your correct HTTPS URL: define('WP_HOME', 'https://yourdomain.com'); define('WP_SITEURL', 'https://yourdomain.com');. 2) If using Cloudflare, change your SSL/TLS encryption mode from "Flexible" to "Full (strict)". 3) Clear browser cookies for your domain.

1. Problem Diagnosis & Symptoms

Browsers abort requests after 20 consecutive redirects with ERR_TOO_MANY_REDIRECTS.

2. Primary Root Causes

  • Cause: Site URL set to http:// while .htaccess forces https://.
  • Cause: Cloudflare Flexible SSL forwarding unencrypted HTTP requests to an origin server that redirects back to HTTPS.

3. Step-by-Step Diagnostic Fixes

1

Hardcode Site URLs in wp-config.php

Override database values to stop redirect ping-pong:

PHP
define( 'WP_HOME', 'https://gardenwargame.online' );
define( 'WP_SITEURL', 'https://gardenwargame.online' );

4. How to Verify the Resolution

  • ✔ Open site in Incognito mode and confirm immediate 200 OK load.

5. Diagnostic Troubleshooting Matrix

Symptom Observed Root Cause Recommended Action
Loop only happens when Cloudflare is active Flexible SSL communicates with origin over port 80 Set Cloudflare SSL mode to Full (strict)

6. Critical Mistakes to Avoid

  • ❌ Testing redirect fixes without clearing browser cache.

7. Frequently Asked Questions

❓ How do I tell WordPress it is behind a reverse proxy?

Add if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') { $_SERVER['HTTPS'] = 'on'; } to wp-config.php.

Official Technical References

Advertisement

Google AdSense In-Article Matched Content Unit