[FIX] ERR_TOO_MANY_REDIRECTS on WordPress (2021)

We see a lot of different WordPress errors at CollectiveRay, and one of them is ERR_TOO_MANY_REDIRECTS (also known as a redirect loop).

This typically happens as a result of a new update to your WordPress platform, a misconfiguration of redirects on your server, or inappropriate configurations for third-party providers. But don't worry, this mistake is pretty simple to fix.

Check out the tips below for how to resolve this error and get the site up and running again.

What is the err_too_many_redirects error?

The reason why ERR_TOO_MANY_REDIRECTS is triggered is easily reflected in the error itself. Something (a misconfiguration) is triggering a disproportionate amount of redirects (too many redirects), causing your website to go into a continuous redirection loop.

Essentially, the server is trapped (for example, URL 1 points to URL 2 and URL 2 points back to URL 1, or the domain has forwarded you too many times). This types of error is typically an incorrect system setup, so it's hard for these errors to get resolved by themselves.

This is why we have a step-by-step guide on what steps you need to take to resolve this issue.

Depending on the browser you're using, there are a few different variants of this warning/error.

ERR_TOO_MANY_REDIRECTS Chrome


This error will be shown in Google Chrome as ERR_TOO_MANY_REDIRECTS (as seen below) or This webpage has a redirect loop issue.

This page isn’t working. example.com redirected you too many times. Try clearing you cookies. ERR_TOO_MANY_REDIRECTS

What is the err too many redirects error

Other Google Chrome problems that can be fixed easily include the err_cache_miss warning.

Microsoft Edge Browser

In the Microsoft Edge browser, it will simply show as This page isn’t working right now (as you can see below).

example.com redirected you too many times.

What is the err too many redirects error1

Firefox

In the Mozilla Firefox browser, this would be shown as The page isn't redirecting properly (as seen in the screenshot below).

An error occured during a connection to example.com. This problem can sometimes be caused by disabling or refusing to accept cookies.

What is the err too many redirects error2

Safari

In the Safari browser, the error will show as Safari Can’t Open the Page (check out the screenshot).

Too many redirects occurred trying to open “example.com.” This might occur if you open a page that is redirected to open another page which is then redirected to open the original page.

 Here are few tips and problems to search for to help resolve the error (sorted by the most common explanations we see):

  1. Delete or clear cookies on that specific site
  2. Clear all caches on the WordPress site, (plugin, server, proxy, and browser cache)
  3. Determine nature of redirect loop
  4. Check that you have the correct HTTPS settings
  5. Check any third-party services
  6. Check your WordPress site settings
  7. Temporarily disable WordPress plugins until you resolve the problem
  8. Check for any redirects on your server

How to Fix ERR_TOO_MANY_REDIRECTS 

1. Delete Browser Cookies for That Specific Site

As we saw in the screenshots above, both Google and Mozilla advise right below the error to "try clearing your cookies."

Cookies can get corrupted and have erroneous data, resulting in the ERR TOO MANY REDIRECTS error. This is a fix you should try even though you're getting the error on a platform or website that you don't own.

Since cookies maintain your "logged in" status and other settings on website, we suggest simply removing the cookie(s) on the site that is causing the issue. This way, you won't cause any problems with any of the other website sessions or regularly visited websites.

To delete a cookie from a particular website in Google Chrome, follow the steps below.

  1. Click the three little dots in the upper right-hand corner of Google Chrome. Then choose "Settings."
  2. Scroll down and choose "Advanced."
  3. Click on "Content settings."
  4. Choose “Cookies.”
  5. Next, choose “See all cookies and site data."
  6. Look for the site (domain) that is triggering the ERR_TOO_MANY_REDIRECTS warning. The cookie(s) currently saved on your computer for that domain will then be removed. Then return to the website and refresh the page.

If the problem was caused by browser cookies, the error will not be gone and the page will load correctly.

2. Clear Server, Proxy, and Browser Cache

Since redirect loops can be triggered by caching responses, it's always a good idea to try clearing the cache on your WordPress account, the server, third-party proxy servers, and even your browser if required.

Depending on the type of redirect loop, you might still be able to acess your WordPress admin dashboard. In this case, you can conveniently flush or clear the cache from your caching plugin's settings. 

Here's is a brief guide on how to clear the caches on the various pieces of instrastructure that could have caching. You might need to check what plugins your website is running, or whether there is a different caching platform that we haven't mentioned below. 

Make sure that you clear, flush or purge the caches on each caching component.

Clear WordPress Site Cache

If you are caching your site using a WordPress caching plugin such as W3C, SuperCacher or even WP Rocket, flushing the cache on these plugins is usually very straightforward and is something which you probably have done several times. 

Simply follow your usual procedure to purge the relevant caching plugin.

Clear Server Cache

Some mananged WordPress hosting services such as Kinsta, WPEngine, Nexcess or SiteGround have their own server-level caching. All of these have their own procedures to follow to flush the caches. This should be easily accessible via your hosting dashboard.

Clear CDN or Proxy Cache

If you use a third-party reverse-proxy service, such as Cloudflare or Sucuri, clearing the cache on their end may also be helpful. Although not all CDN's work as proxies, if you are on a CDN, you might want to flush or purge the cache here too. 

  • Sign in to Cloudflare's dashboard, navigate to "Caching," and then hit "Purge Everything."
  • Log in to Sucuri's dashboard, navigate to "Performance," and then press "Clear Cache."

 

Clear Browser Cache

If you need to see if it's your local browser cache that is causing the problem, you can open your browser in incognito mode without deleting your cache. Alternatively, use another browser to see if the ERR_TOO_MANY_REDIRECTS error persists.

If you determine that it is due to the browser cache, you need to clear it. Here are guidelines for doing so in different browsers:

Clear your web browser's cache, cookies, and history

Determine the Type of The Redirect Loop


If clearing the cache didn't work, you'll want to try and figure out what's causing the redirect loop. HTTPStatus.io - a free online redirect checker tool will assist with further analysis on what is going on at the backend.

This may also be accomplished with cURL.

On the site below, for example, there is a 301 redirect loop back to itself, resulting in a long chain of defective redirects. You should follow all of the redirects and see if it is looping back to itself, or if it is an HTTP to HTTPS loop, which we will address below.

301 Redirect
https://example.com
301 Redirect
https://example.com
301 Redirect
https://example.com
301 Redirect
https://example.com

The Redirect Path Chrome extension is also very helpful, since it offers information on any of the redirects that occur on your web (specific URL or page).

Check Your HTTPS Configuration


Another thing to double-check is the HTTPS setup. We've seen ERR_TOO_MANY_REDIRECTS arise often where someone has just moved their WordPress platform to HTTPS and then didn't finish the set up correctly.

1. Do not force HTTPS if you haven't installed an SSL certificate.


This is by far the most popular explanation we experience very often. If you force your WordPress site to load over HTTPS without first setting up an SSL certificate, your site will automatically create a redirect loop. To fix this problem, simply install an SSL certificate on your WordPress site's account. You can use either a commercially bought certificate, or else use Let's Encrypt if this is supported by your hosting set up.

It's also a smart idea to run an SSL scan (from Qualys SSL Labs) on your site. SSL/TLS certificates require the installation of not only the primary certificate, but also what are known as intermediate certificates (chain). These must be correctly installed, otherwise your set up will not be correct and may create all sorts of problems.

Simply go to the SSL checker, linked above, enter your domain in the Hostname field, and press "Submit." You can choose to not make the results of the scan public. Note that the scanning of your site's SSL/TLS configuration on your web server can take a minute or two.

There are some free SSL WordPress plugins available, such as the Really Simple SSL plugin, that will help you in automatically redirecting to HTTPS.

However, we do not suggest this approach as a long-term solution because third-party plugins can introduce new bugs or cause other performance issues. While it may be an easy temporary workaround, you should still endevour to convert your hard-coded HTTP:// links to HTTPS://.

You can achieve this with a tool such as Better Search Replace in WordPress or get in touch with your hosting support team to get this handled for you.

3. Check any HTTP to HTTPS Redirects on the Server

Another reason for the error could be that the HTTPS redirect rules on your server are misconfigured.

If your web server is running Nginx, you can easily redirect all HTTP traffic to HTTPS by applying the following code to your Nginx config file. This is the preferred approach for redirecting WordPress on Nginx.

server { listen 80; server_name example.com www.example.com; return 301 https://example.com$request_uri; }

If you have an Apache web server, you can also easily redirect all HTTP traffic to HTTPS by applying the following code to your .htaccess file. This is the preferred approach for redirecting WordPress using the Apache server.

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

4. Check for Too Many HTTPS Redirects

Another possbility is that you have too many HTTPS redirects. You can use the Redirect mapper feature, to quickly idenitfy how many redirects your site has. Below is an example of a redirect that wasn't set up right, and is easy to find using the redirect mapper. There are duplicate HTTPS redirects on both the www and non-www editions, as you can see.

https redirects not setup correctly

 

Check Third-Party Services

The ERR_TOO_MANY_REDIRECTS error is often triggered by reverse-proxy services such as Cloudflare, or other reverse proxy services.

This is what might happen when their Flexible SSL option is enabled and you already have an SSL certificate installed with your WordPress host.

Why does this happen?

When you choose Flexible SLL, all requests to your hosting server are sent via HTTP. Since your host server already has a redirect from HTTP to HTTPS in place, a redirect loop happens.

To overcome this, change the Cloudflare Crypto settings from Flexible to Full or Full (strict).

You should use their Always Use HTTPS page rule to automatically redirect all users to HTTPS without causing a loop. Another issue to be aware of with Cloudflare is their forwarding URL redirection rules.

Be sure not to build a redirect in which the domain refers to itself as a destination. This will result in an infinite redirect loop, and the URLs affected would be unable to resolve correctly.

If you prefer to use only Cloudflare's DNS and not their proxy/WAF service, make sure your DNS records are set to "DNS Only." The cloud icon would look "blue" rather than "orange." This can be seen in the Cloudflare control panel under the “DNS” tab.

If you're using StackPath, make sure the "Origin Pull Protocol" option is set to HTTPS only.

Check Your WordPress Site Configuration


Another thing to look at is the WordPress site settings. You'll want to double-check if the two fields are set properly and aren't referring to the same domain, or are mismatched. Another typical problem is failing to use the right prefix to match the rest of the domain, whether www or non-www. When people migrate hosts or shift domains, these settings may be changed without your noticing.

  • WordPress Address (URL): The URL to reach your site.
  • Site URL (Uniform Resource Locator): The location of your WordPress core files.


These should match, unless WordPress is being used it its own directory.

If these settings are not set correctly, you will be unable to access your WordPress dashboard. So you can circumvent the above settings by changing the values in your wp-config.php file.

The wp-config.php file is normally found at the root of your WordPress site and can be accessed via FTP, SSH, or WP-CLI. Simply add the following code to the top of the file to hard-code WP_HOME and WP_SITEURL, modifying the values to reflect your domain.

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

Check Your WordPress Site Configuration

 
After manually configuring the two values, you can visit your site and see whether it resolves the redirect loop.

WordPress Multisite

When moving domains on a multisite, make sure to search the wp_blogs table as well. If you perform an incorrect search and replace, this can result in an infinite redirect loop. This is due to the network site not matching the subsites.

wp_#_options: For each subsite, a series of tables will be generated that correspond to the blog id in the wp blogs table. Update the “SITEURL” and “HOME” settings in the wp_#_options table, where # refers to the blog id.

Disable WordPress Plugins Temporarily

When it comes to WordPress, briefly removing all WordPress plugins can be a fast way to identify issues. Redirects, for example, may be implemented using plugins such as Redirection or Yoast SEO premium. Often any changes in configuration or other alterations to these plugins will clash with redirects that are already in place on your server, resulting in a redirect loop.

Remember that merely disabling a plugin will not result in data loss, so this is a fairly risk-free fix. If you can't reach the WordPress admin, you'll need to connect to your server through SFTP and rename your plugins folder to something like plugins old. Then double-check your website to see whether the redirect loop is gone.

If it works, you'll need to verify each plugin one-by-one and see whether it is the one causing the problem. Rename your plugin folder back to "plugins," then rename each plugin folder inside it one by one until you locate the one which causes a problem.

You might want to test this on a staging site first. 

Check any existing Server Redirects


Apart from HTTP to HTTPS redirects on your server, it's a good idea to double-check whether there aren't any other redirects set up incorrectly. For eg, a single bad 301 redirect back to itself might bring the site down. This are usually contained in your server's configuration files.

.htaccess file in Apache

If you're using an Apache-powered WordPress host, it's likely that your .htaccess file includes an incorrect config. To make a new one from scratch, follow the steps below.

Connect to your site using FTP or SSH and rename your .htaccess file to .htaccess-old. This means that you still have a backup of the old configureation.

Normally, you should easily saave your permalinks in WordPress to restore this file.

However, if you're seeing an ERR_TOO_MANY_REDIRECTS bug, you won't be able to log in to your WordPress admin, so this isn't an available option. As a result, you should create a new .htaccess file with the following code. The following example uses default settings.

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress


More examples, such as a default .htaccess file for multisite, can be found in the WordPress Codex

Nginx Configuration


If your server uses Nginx, this configuration could be a little more difficult to find because the config file varies based on the hosting service. We recommend contacting your host and having them search your config file for something that may be triggering a redirect loop or an excessive number of redirects.

Reverse Proxies That Are Misconfigured

Another common source of the ERR_TOO_MANY_REDIRECTS error is the use of a reverse proxy. Reverse proxies can be very troublesome, and if set up incorrectly, it is quite easy to send the WordPress site into a redirect loop.

Wrapping Up

Redirect loops can be difficult to find at times. However, some of the troubleshooting measures outlined above will assist you in resolving your ERR_TOO_MANY_REDIRECTS error. If we missed something, please let us know in the comments section below.

About the Author
Shahzad Saeed
Author: Shahzad SaeedWebsite: http://shahzadsaeed.com/
Shahzaad Saaed has been featured in a large number of authority websites, as a WordPress expert. He specializes in content marketing to help business grow their traffic.

One more thing... Did you know that people who share useful stuff like this post look AWESOME too? ;-)
Please leave a useful comment with your thoughts, then share this on your Facebook group(s) who would find this useful and let's reap the benefits together. Thank you for sharing and being nice!

Disclosure: This page may contain links to external sites for products which we love and wholeheartedly recommend. If you buy products we suggest, we may earn a referral fee. Such fees do not influence our recommendations and we do not accept payments for positive reviews.

Author(s) Featured On:  Inc Magazine Logo   Sitepoint logo   CSS Tricks logo    webdesignerdepot logo   WPMU DEV logo   and many more ...