Ffile2fix
Sign in Get started

Fix "ERR_TOO_MANY_REDIRECTS"

This page isn't working
example.com redirected you too many times.
Try deleting your cookies.
ERR_TOO_MANY_REDIRECTS

This error means the browser was sent from one URL to another in a circle and gave up. The most common cause is two layers disagreeing about HTTPS, for example Cloudflare Flexible SSL sending HTTP to a server that redirects everything to HTTPS.

Also appears as: The page isn't redirecting properly. Firefox has detected that the server is redirecting the request for this address in a way that will never complete. · Safari Can't Open the Page. Too many redirects occurred trying to open "https://example.com". · curl: (47) Maximum (50) redirects followed · net::ERR_TOO_MANY_REDIRECTS

Common causes

  • Cloudflare SSL mode set to Flexible while the server forces HTTPS
  • WordPress Site URL and Home URL disagree with the server's www or HTTPS redirect
  • Duplicate HTTPS or www rules in .htaccess, Nginx and a plugin at the same time
  • A load balancer terminates SSL and the app does not trust X-Forwarded-Proto
  • A login or cookie check that redirects to itself
  • Stale cookies or cached redirects in the browser

How to fix it

  1. Trace the redirect chain. Run curl -sIL https://example.com | grep -i -E '^(HTTP|location)' to see each hop. The repeating pair of URLs tells you which rules are fighting.
  2. Fix Cloudflare SSL mode. If you use Cloudflare, go to SSL/TLS > Overview and set the mode to Full (strict), with a valid certificate on the origin. Flexible mode causes loops with HTTPS redirects.
  3. Align WordPress URLs. Set WP_HOME and WP_SITEURL in wp-config.php to the exact final URL, for example https://www.example.com. They must match the server's redirect target.
  4. Keep one redirect rule. Pick one place to force HTTPS and www: the server config, .htaccess or a plugin. Remove duplicates from the others.
  5. Trust the proxy header. Behind a load balancer, check X-Forwarded-Proto before redirecting. In WordPress add if ($_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') $_SERVER['HTTPS'] = 'on'; to wp-config.php.
  6. Clear cookies and cache. Clear the site's cookies, purge any CDN or page cache, and test in a private window. Browsers cache 301 redirects.

Single .htaccess rule forcing HTTPS and www without a loop

RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^ https://www.example.com%{REQUEST_URI} [L,R=301]

How to stop it happening again

  • Force HTTPS in exactly one place
  • Use Full (strict) SSL with Cloudflare
  • Update site URLs when changing domains or protocols
  • Test redirects with curl after every change

Frequently asked questions

Does clearing cookies fix it?

Only when a bad cookie causes the loop. Most loops come from server rules and come back for every visitor until the rules are fixed.

Why did it start after installing an SSL plugin?

The plugin forces HTTPS while something else, often Cloudflare Flexible mode or a proxy, sends HTTP to the server. Each side keeps redirecting.

How many redirects are too many?

Chrome stops after about 20 hops. Good setups use one redirect at most.