[FIX] ERR_TOO_MANY_REDIRECTS on WordPress (2022)
We see many different WordPress errors at CollectiveRay, and one of them is ERR_TOO_MANY_REDIRECTS (also known as a redirect loop).
This usually 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 quite easy to fix.
Check out the tips below to resolve this error and get your website up and running again.
What is the error err_too_many_redirects?
The reason why ERR_TOO_MANY_REDIRECTS is triggered is easily reflected in the error itself. Something (a misconfiguration) triggers a disproportionate amount of redirects (too many redirects), causing your site to enter a continuous redirect loop.
Essentially, the server is trapped (eg URL 1 points to URL 2 and URL 2 points back to URL 1, or the domain has forwarded you too many times). These types of errors are usually a faulty system installation, so it is difficult for these errors to resolve themselves.
That's why we have a step-by-step guide on what steps you need to take to solve the problem.
Depending on the browser you are using, there are a few different variations of this warning / error.
ERR_TOO_MANY_REDIRECTS Chrome
This error appears in Google Chrome as ERR_TOO_MANY_REDIRECTS (as below) or This webpage has a problem with redirection.
This page is not working. example.com redirected you too many times. Try clearing cookies. ERR_TOO_MANY_REDIRECTS
Other Google Chrome issues that can be easily fixed include the err_cache_miss warning .
Microsoft Edge Browser
In the Microsoft Edge browser, it will simply appear as This page is not working right now (as you can see below).
example.com redirected you too many times.
firefox
In the Mozilla Firefox browser, this would appear because the page is not properly redirected (as shown in the screenshot below).
An error occurred while connecting to example.com. This problem can sometimes be caused by disabling or refusing to accept cookies.
Safari
In the Safari browser, the error Safari cannot open the page appears (check out the screenshot).
Too many redirects occurred when trying to open "example.com". This can happen if you open a page that redirects to open another page that then redirects to open the original page.
Here are some tips and issues to look for to resolve the error (sorted by the most common explanations we see):
- Delete or clear cookies on the specific website
- Clear all WordPress site caches (plugin, server, proxy and browser cache)
- Determine the nature of the redirection loop
- Make sure you have the correct HTTPS settings
- Check for any third-party services
- Check your WordPress site settings
- Temporarily disable WordPress plugins until you resolve the issue
- Check if there are any redirects on your server
How to fix ERR_TOO_MANY_REDIRECTS
1. Delete browser cookies for the specific website
As we saw in the screenshots above, both Google and Mozilla recommend right below the error to "try clearing your cookies."
Cookies can become corrupted and have incorrect data, resulting in the ERROR TOO MANY REDIRECTS error. This is a fix you should try even if you're getting the error on a platform or website you don't own.
Since cookies retain your "logged in" status and other settings on the website, we suggest you delete the cookies on the website causing the problem. That way, you won't cause any problems with any of the other site's sessions or regularly visited sites.
To remove a cookie from a specific website in Google Chrome, follow the steps below.
- Click on the three small dots in the upper right corner of Google Chrome. Then select "Settings".
- Scroll down and select "Advanced".
- Click on "Content Settings."
- Select "Cookies".
- Then select "See all cookies and website data."
- Look for the website (domain) that is triggering the ERR_TOO_MANY_REDIRECTS warning. The cookie(s) currently stored on your computer for that domain will then be deleted. Then go back to the website and refresh the page.
If the problem was caused by browser cookies, the error will not go away 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, server, third-party proxies, and even your browser if necessary.
Depending on the type of redirect loop, you may still be able to access your WordPress admin panel. In this case, you can easily flush or clear the cache from your cache plugin settings.
Here is a short guide on how to clear the cache on the various pieces of infrastructure that may have caching. You may need to check what plugins your site is running, or if there is another caching platform that we haven't mentioned below.
Make sure you clear, flush, or clear the cache on each caching component.
Clear WordPress site cache
If you cache your site using a WordPress caching plugin like W3C, SuperCacher or even WP Rocket, flushing the cache of these plugins is usually very easy and is something you've probably done several times.
Just follow your normal procedure to clear the relevant cache plugin.
Clear server cache
Some managed 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 cache. This should be easily accessible through your hosting panel.
Clear CDN or Proxy Cache
If you use a third-party reverse proxy service, e.g. CloudFlare or Sucuri , clearing the cache at the end can also help. Although not all CDNs act as proxies, if you are on a CDN, you may want to flush or clear the cache here as well.
- Log in to the Cloudflare dashboard, navigate to "Caching" and then tap "Clear All".
- Log in to the Sucuri dashboard, navigate to "Performance" and then tap "Clear Cache".
Clear the browser cache
If you need to see if your local browser cache is causing the problem, you can open your browser in incognito mode without clearing your cache. Alternatively, you can use a different browser to see if the ERR_TOO_MANY_REDIRECTS error persists.
If you decide that it is due to the browser cache, you need to clear it. Here are guidelines on how to do it in different browsers:
Clear your browser's cache, cookies and history
Determine the type of redirection loop
If clearing the cache didn't work, you'll want to try to figure out what's causing the redirect loop. HTTPStatus.io - A free online redirection tool helps with further analysis of what's happening in the backend.
This can also be accomplished with cURL.
For example, the website below has a 301 redirect loop back on itself, resulting in a long chain of broken redirects. You should follow any redirects and see if it loops back on itself, or if it's an HTTP to HTTPS loop, which we'll cover below.
301 Redirect
https://example.com
301 Redirect
https://example.com
301 Redirect
https://example.com
301 Redirect
https://example.com
You now have the option Redirect Path Chrome extension is also very helpful, as it offers information about any of the redirects that happen 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 occur frequently where someone has just moved their WordPress platform to HTTPS and then not finished the installation correctly.
1. Do not force HTTPS unless you have an SSL certificate installed.
This is by far the most popular explanation we experience very often. If you force your WordPress site to load over HTTPS without first configuring an SSL certificate, your site will automatically create a redirect loop. To fix the problem, simply install an SSL certificate on your WordPress site. You can use either a commercially purchased certificate or else use Let's Encrypt if this is supported by your web host.
It's also a smart idea to run an SSL scan (from Qualys SSL Labs) on your website. SSL / TLS certificates not only require installation of the primary certificate, but also so-called intermediate certificates (chain). These must be properly installed, otherwise your setup is not correct and can create all sorts of problems.
Simply go to the SSL Checker, linked above, enter your domain in the hostname field and hit 'Submit'. You can choose not to make the results of the scan public. Please note that scanning the site's SSL / TLS configuration on your web server may take a minute or two.
2. Update all hardcoded links instead of using an SSL plugin
There are some free SSL WordPress plugins available, such as the Really Simple SSL plugin, which will help you automatically redirect to HTTPS.
However, we do not suggest this approach as a long-term solution, as third-party plug-ins may introduce new bugs or cause other performance issues. While it may be a simple temporary fix, you should still aim to convert your hardcoded HTTP:// links to HTTPS://.
You can achieve this with a tool like Better Search Replace in WordPress or contact your hosting team to handle this for you.
3. Check for 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 in your Nginx configuration file. This is the preferred approach for redirecting WordPress to 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 in your .htaccess file. This is the preferred way to redirect WordPress using the Apache server.
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
4. Check if there are too many HTTPS redirects
Another possibility is that you have too many HTTPS redirects. You can use Redirect Map to quickly identify how many redirects your website has. Below is an example of a redirect that was not set up correctly and is easy to find with the redirect mapper. There are duplicate HTTPS redirects on both the www and non-www editions, as you can see.
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 can happen when their Flexible SSL option is enabled and you already have an SSL certificate installed with your WordPress host.
Why is this happening?
When you choose Flexible SLL, all requests are sent to your hosting server via HTTP. Since your hosting server already has an HTTP to HTTPS redirect 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 consider with Cloudflare is their forwarding of URL rules.
Be sure not to build a redirect where the domain refers to itself as a destination. This leads to an infinite redirect loop and the affected URLs would not be able to be properly resolved.
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 appear "blue" rather than "orange". This can be seen in the Cloudflare control panel under the “DNS” tab.
If you are 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 that the two fields are set correctly and don't refer to the same domain or they don't match. Another typical problem is not using the correct prefix to match the rest of the domain, whether www or non-www. When people migrate hosts or change domains, these settings can change without you noticing.
- WordPress Address (URL): The URL to reach your website.
- URL (Uniform Resource Locator): The location of your WordPress core files.
These should match, unless WordPress uses its own directory.
If these settings are not set correctly, you will not be able to access your WordPress dashboard. So you can bypass the above settings by changing the values in your wp-config.php file.
The wp-config.php file is normally located in the root of your WordPress site and can be accessed via FTP, SSH or WP-CLI. Just add the following code to the top of the file to hardcode WP_HOME and WP_SITEURL, and modify the values to reflect your domain.
define ('WP_HOME', 'https://example.com'); define ('WP_SITEURL', 'https://example.com');

After you configure the two values manually, you can visit your site and see if it resolves the redirect loop.
WordPress Multisite
When moving domains on a multisite, be sure to also search the wp_blogs table. Doing an incorrect search and replace can result in an infinite redirect loop. This is because the network site does not match the subsites.
wp _ # _ option: For each subsite, a series of tables is generated corresponding to the blog id in the wp blog table. Update “ SITEURL "And" HOME Settings in wp _ # _ options table, where # refers to blog id.
Temporarily disable WordPress plugins
In the case of WordPress, removing all WordPress plugins can quickly be a quick way to identify problems. For example, redirects can be implemented using plugins such as Redirection or Yoast SEO premium. Often, any configuration or other changes to these plugins will collide with redirects already on your server, resulting in a redirect loop.
Remember that simply disabling a plugin will not result in data loss, so this is a fairly risk-free solution. If you can't reach the WordPress admin, you need to connect to your server via SFTP and rename your plugins' folder to something like plugins old. Then double-check your site to see if the redirect loop is gone.
If it works, you need to verify each plugin one by one and see if that's what's causing the problem. Rename your plugins folder to "plugins" and rename each plugin folder inside it one by one until you find the one causing a problem.
You may want to test this on a staging site first.


Comments
Post a Comment