How to fix ERR_TOO_MANY_REDIRECTS

Two rules are sending visitors back and forth forever. Usually HTTP and HTTPS, or www and non-www, set differently in two places.

1–2 minutes
Dense bundle of patch cables in a network rack

ERR_TOO_MANY_REDIRECTS (“redirected you too many times”) means the browser followed a loop: page A redirects to B, and B redirects back to A. It nearly always comes from two layers disagreeing about HTTP versus HTTPS, or www versus no www.

If you are visiting the site

Clear cookies for that site, then reload. A stale cookie occasionally causes a loop. If it continues, the site owner has to fix it.

If you run the site

1. Watch the loop

curl -sIL https://example.com | grep -iE '^(HTTP|location)'

The list of Location lines shows exactly which addresses bounce.

2. CDN in front of an HTTPS redirect

The classic case: a CDN connects to your server over plain HTTP, your server redirects to HTTPS, the CDN fetches again over HTTP, forever. Set the CDN’s SSL mode so it connects to your server over HTTPS (often called “Full” or “Full (strict)”), and make sure the server has a valid certificate.

3. WordPress address settings

WordPress redirects to its configured address. If WordPress Address and Site Address say http:// while the server forces https://, or they disagree about www, you get a loop. Fix them without the admin:

wp option update home 'https://example.com'
wp option update siteurl 'https://example.com'

Behind a proxy or CDN, WordPress may not know the visitor arrived over HTTPS. Add this to wp-config.php above the “stop editing” line:

if ( isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) && 'https' === $_SERVER['HTTP_X_FORWARDED_PROTO'] ) {
    $_SERVER['HTTPS'] = 'on';
}

4. Two redirect rules

A plugin forcing HTTPS plus a server rule doing the same, or a www rule in .htaccess that fights the Nginx config. Keep one rule for each job, at the server level, and remove the rest.

Something out of date? Software changes. If a step no longer works, tell us and we will check it and update the page.