What Is ERR_TOO_MANY_REDIRECTS and How Do You Fix a Redirect Loop?

Sunucun 5 min read

ERR_TOO_MANY_REDIRECTS is an error showing that a page keeps sending the browser to another address, which sends it back to the first one; in other words, the browser has entered a redirect loop. Chrome then shows “This page isn’t working” with the message “… redirected you too many times”; in Firefox the same problem appears as “The page isn’t redirecting properly”. In this guide we explain the causes of the error and how to fix it as a visitor and as a site owner.

Illustration: What Is ERR_TOO_MANY_RE…

What Does ERR_TOO_MANY_REDIRECTS Mean?

Sites use redirects (usually 301 or 302) to move one address to another, for example to send a visitor who arrives over http:// to the https:// address. The problem starts when two rules cancel each other out: address A redirects to B, and B redirects back to A. After following this chain a certain number of times (about 20 in Chrome), the browser realizes it is in a loop and stops the request.

Causes of the ERR_TOO_MANY_REDIRECTS Error

CauseHow the loop forms
Cloudflare “Flexible” SSL modeCloudflare reaches the server over HTTP, the server redirects to HTTPS, Cloudflare comes back over HTTP again
HTTP ↔ HTTPS rule conflictOne rule redirects to HTTPS while another (a plugin, the panel or a CDN) redirects to HTTP
www ↔ non-www conflictThe server redirects to www while the application redirects to the non-www address
WordPress address settingsThe WordPress Address and Site Address do not match the address the server redirects to
Plugin conflictSSL, caching or redirect plugins do the same job in opposite directions
Broken cookieAn old cookie left in the browser makes the site keep redirecting the visitor

How to Fix ERR_TOO_MANY_REDIRECTS as a Visitor

The loop usually comes from the site’s settings, but old data in the browser can lead to the same result. Try these steps:

  1. Delete the cookies for that site only: In Chrome, click the site icon in the address bar, delete the site’s data under Cookies and site data and reload the page. To clear all browser data, follow the steps in our article on clearing cookies.
  2. Try an incognito window: If the site opens in incognito, the problem is most likely the cookies or an extension.
  3. Turn off extensions: Temporarily disable extensions that force HTTPS, block ads or perform redirects.
  4. Check the date and time: A wrong clock can make session and security cookies count as invalid.

If the error continues after these steps and also appears on other devices, the problem is on the site; let the site owner know.

How to Fix ERR_TOO_MANY_REDIRECTS as a Site Owner

1. See the Redirect Chain

Seeing which addresses the loop runs between speeds up the fix. On the command line, this command lists the status code and target of each redirect:

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

If the same two addresses keep repeating in the output, you know the two sides of the loop: for example http ↔ https, or www ↔ non-www.

2. Fix the Cloudflare SSL Mode

On sites behind Cloudflare, the most common cause is the Flexible SSL mode. In this mode Cloudflare talks to the visitor over HTTPS but to your server over HTTP; because your server redirects HTTP requests to HTTPS, a loop forms. To fix it, make sure your server has a valid SSL certificate and set the SSL/TLS mode in the Cloudflare dashboard to Full (strict). We explain how Cloudflare works in our article what is Cloudflare.

3. Check the WordPress Address Settings

In WordPress, the WordPress Address (URL) and Site Address (URL) under Settings > General must exactly match the address the site actually opens on, including the https and www choice. If you cannot log in to the dashboard, you can fix these values by adding them to the wp-config.php file:

define('WP_HOME', 'https://yourdomain.com');
define('WP_SITEURL', 'https://yourdomain.com');

If the site sits behind a reverse proxy or load balancer, WordPress may not recognize that the request is HTTPS. In that case you need to make HTTPS recognized based on the X-Forwarded-Proto header the proxy sends.

4. Disable Plugins

If you cannot reach the dashboard, temporarily rename the wp-content/plugins folder over FTP or the file manager; this turns off all plugins. If the site opens, rename the folder back and activate the plugins one by one to find the one causing the loop. Plugins that force SSL, caching plugins and redirect plugins are the first suspects.

5. Review .htaccess and Server Redirects

On Apache and LiteSpeed servers, redirect rules usually live in the .htaccess file. Make sure there are not several rules doing the same job (for example an HTTPS redirect added both from the panel and by hand). A single, correct rule for HTTPS plus the preferred domain is enough. Also check the “Force HTTPS” and redirect settings in cPanel or Plesk; do not define the same redirect both in the panel and in the file.

6. Clear the Caches

After fixing the settings, clear the server, plugin and CDN caches. If redirects remain cached, the error can still appear for a while even after the fix.

How It Relates to SSL Settings

ERR_TOO_MANY_REDIRECTS often appears while a site is being moved to HTTPS. When the certificate is not installed correctly, certificate errors appear instead of a loop. For a list of these errors and their fixes, see our guide what is an SSL error.

Conclusion

ERR_TOO_MANY_REDIRECTS shows that two redirect rules have put each other into a loop. For visitors, deleting that site’s cookies is usually enough. As a site owner, look at the redirect chain first, then check the Cloudflare SSL mode, the WordPress address settings, the plugins and the .htaccess rules one by one.

Categories

Latest guides