How to Fix The ERRTOOMANYREDIRECTS Error

We run into a lot of different errors here at kinsta, and err_too_many_redirects (aka redirect loop) is one we see regularly. This usually happens after a recent change to your website, a misconfiguration of redirects on your server, or misconfigurations with third-party services. but don’t worry, this error is quite easy to fix.

See the recommendations below on how to fix this error and get your site back up and running.

what is the err_too_many_redirects error?

The reason for err_too_many_redirects is pretty much what it sounds like, something is causing too many redirects, sending your website into an infinite redirect loop.

Basically, the site is stuck (for example, url 1 points to url 2 and url 2 points to url 1, or the domain has redirected it too many times), and unlike other errors, these rarely Sometimes they resolve themselves and will likely need you to take action to fix them.

You may also have encountered the error “The request exceeded the limit of 10 internal redirects due to a probable configuration error“.

There are a couple of different variations of this error depending on the browser you are using.

google chrome

In google chrome, this error will show as err_too_many_redirects (as seen below) or this web page has a redirect loop problem.

this page does not work. domain.com redirected you too many times.

ERR_TOO_MANY_REDIRECTS in Google Chrome

ERR_TOO_MANY_REDIRECTS in Google Chrome

(Check out how to fix Chrome’s ERR_CACHE_MISS error).

mozilla firefox

in mozilla firefox it will show as the page is not redirecting properly (as seen below).

An error occurred during a connection to domain.com. this problem can sometimes be caused by disabling or refusing to accept cookies.

ERR_TOO_MANY_REDIRECTS in Firefox

ERR_TOO_MANY_REDIRECTS in Mozilla Firefox

Microsoft Edge

on microsoft edge, it will simply display as this page is not working right now (as seen below).

domain.com redirected you too many times.

ERR_TOO_MANY_REDIRECTS in Microsoft Edge

ERR_TOO_MANY_REDIRECTS in Microsoft Edge

Safari

in safari, it will show as safari can’t open page (as seen below).

too many redirects occurred while trying to open “domain.com”. this can happen if you open a page that redirects to open another page that then redirects to open the original page.

ERR_TOO_MANY_REDIRECTS error in Safari

ERR_TOO_MANY_REDIRECTS error in Safari

Here are some recommendations and things to check to fix the error (sorted in order by most common reasons we see):

  • delete the cookies on that specific site
  • clear the wordpress site, server, proxy and browser cache
  • determine the nature of the loop redirecting
  • check your https settings
  • check third party services
  • check your wordpress site settings
  • temporarily disable wordpress plugins
  • check redirects on your server

delete cookies on that specific site

Google and Mozilla, in fact, recommend just below the “try to clear cookies” error. cookies can sometimes contain faulty data that could cause the err_too_many_redirects error. this is a recommendation you can try even if you encounter the error on a site you don’t own.

Due to the fact that cookies retain your site “login” status and other settings, we recommend simply delete the cookie(s) on the site who has the problem. this way it won’t affect any of your other sessions or frequently visited websites.

Follow the steps below to delete a cookie on a specific website in google chrome.

step 1

In google chrome, click on the three little dots in the top right corner. then click “settings”.

Chrome settings

Chrome settings

Step 2

scroll down and click “advanced”.

Chrome advanced settings

Chrome advanced settings

Step 3

then click “content settings”.

Chrome content settings

Chrome content settings

Step 4

click on “cookies”.

Chrome cookies

Chrome cookies

Step 5

then click “view all cookies and site data”.

Chrome see all cookies

Chrome see all cookies

Step 6

find the site (domain) where you find the err_too_many_redirects error. you can then delete the cookies currently stored on your computer for that domain. then try visiting the site again.

Delete cookie in Chrome

Delete cookie in Chrome

Clear Server, Proxy, and Browser Cache

Due to the fact that redirect loops are cacheable responses, it is always recommended to try to clear the cache on your wordpress site, server, third party proxy services and even your browser if necessary.

clear wordpress site cache

Depending on the type of redirect loop, you may still be able to gain access to your wordpress admin panel. in this case, you can easily clear the cache within the settings of your caching plugin. here are a couple of quick links on how to clear wordpress cache with popular plugins:

  • clear cache with cache enabler
  • clear cache with w3 total cache
  • clear cache with supercache
See Also:  How to Start an Ubuntu Mail Server - a Complete Beginners Guide

if you are a kinsta customer, you can easily clear your cache from the wordpress admin toolbar.

Clear Kinsta cache from WordPress admin

Clear Kinsta cache from WordPress admin

Clear Server Cache

if you can’t access the wordpress admin, many wordpress hosts have their own control panel tools to clear the cache on your wordpress site.

If you are a kinsta customer, you can manually clear the wordpress cache from the mykinsta dashboard. just click on your site, click on tools and click on the “clear cache” button. then check your site to see if the redirect loop still exists.

Clear WordPress cache

Clear WordPress cache

Clear Proxy Cache

If you are using a third party reverse proxy service such as cloudflare or sucuri, it may also be beneficial to clear the cache on their side.

cloud flare

To purge cloudflare’s cache, log in to your dashboard, click “caching” and click “purge all”.

Purge cache

sucuri

To purge sucuri’s cache, log in to your dashboard, go to “performance” and click “clear cache”.

Clear Sucuri cache

Clear Sucuri cache

Clear Browser Cache

If you want to check and see if it might be your browser’s cache, without clearing your cache, you can always open your browser in incognito mode. Or try another browser and see if you still see the err_too_many_redirects error.

Open Chrome in Incognito mode

Open Chrome in Incognito mode

If you determine it is being caused by your browser cache, you can then clear it. Below are instructions on how to do it in various browsers:

  • how to force a single page refresh for all browsers
  • how to clear browser cache for google chrome
  • how to clear browser cache for mozilla firefox
  • how to clear browser cache for safari
  • how to clear browser cache for internet explorer
  • how to clear browser cache for microsoft edge
  • how to clear browser cache for opera

determine the nature of the redirect loop

If clearing the cache didn’t work, you’ll want to see if you can determine the nature of the redirect loop. our free online redirect check tool can help provide a more detailed analysis of what might be going on. this can also be done via curl.

For example, on the site below, it has a 301 redirect loop back to itself, causing a long chain of bad redirects. you can follow all the redirects and determine if it’s returning to itself or not, or if it’s a http to https loop which we’ll discuss how to resolve later.

Too many redirects

Too many redirects

The Redirect Path Chrome extension can also be very useful and provides insights into all of the redirects happening on your site (specific URL or page.

Redirect Path extension

Redirect Path extension

Check Your HTTPS Settings

Another thing to check is your https settings. many times we have seen err_too_many_redirects when someone just migrated their wordpress site to https and didn’t finish or configured something incorrectly.

1. don’t force https without an ssl certificate

This is by far the most common reason we see on a regular basis. If you force your wordpress site to load over https without first installing an ssl certificate, it will instantly throw your site into a redirect loop. To fix this simply install an ssl certificate on your wordpress site.

It is also recommended to run an ssl check. ssl/tls certificates require not only your main certificate, but also what they call intermediate (chain) certificates to be installed. these must be configured correctly.

We recommend using the free ssl checker tool from qualys ssl labs. it is very reliable and we use it for all kinsta clients when verifying certificates. simply go to your ssl verification tool, enter your domain in the hostname field and click “submit”. you can also select the option to hide public results if you prefer. scanning your site’s ssl/tls configuration on your web server might take a minute or two.

SSL check

SSL test

2. Don’t Use an SSL Plugin, Update your Hard-coded Links

There are some free wordpress ssl plugins out there, like the really simple ssl plugin that will help you automatically redirect to https. however, we do not recommend this method as a permanent solution because third-party plugins can always introduce another layer of problems and compatibility issues. It’s a good temporary solution, but you really should update your encoded http links.

See Also:  What is Gmail sync? How to fix Gmail sync error ?

We have an excellent tutorial with 4 easy ways to search and replace in wordpress. if you’re a kinsta customer, you can always contact our support team to do that for you too.

3. check http to https redirects on server

It is very possible that the https redirect rules on your server are misconfigured.

redirect http to https in nginx

4. check for too many https redirects

maybe you just have too many https redirects. You can easily check your site to see how many redirects you are using with Patrick Sexton’s redirect mapping tool. here is an example below of redirects that are not configured correctly and can be easily detected with the redirect mapper. you can see that there are duplicate https redirects in the www and non-www versions.

redirects not setup correctly

Redirects

Check Third-Party Services

err_too_many_redirects is also usually caused by reverse proxy services like cloudflare. This usually happens when your flexible ssl option is enabled and you already have an ssl certificate installed with your wordpress host. why? because, when flexible is selected, all requests to your hosting server are sent over http. most likely your host server already has a redirect from http to https and thus a redirect loop occurs.

To fix this, you need to change cloudflare’s crypto settings from soft to full or full (strict). If you’re a kinsta customer, be sure to also check out our steps on how to install an ssl certificate while using cloudflare.

Cloudflare full

Set Cloudflare crypto level to full

You can use their Always Use HTTPS page rule to redirect all users to HTTPS without creating a loop. Another thing to watch out for with Cloudflare is their forwarding URL redirection rules. Be careful not to create a redirect where the domain points to itself as a destination. This can cause an infinite redirect error, and the affected URLs will not be able to resolve.

if you’re using stackpath they have an option called “origin pull protocol” which should be set to https only.

using only cloudflare dns

If you only want to use cloudflare’s dns, and not your proxy/waf service, you need to make sure your dns records are set to “dns only”. clouds will appear as “grey” instead of “orange”. configure this in the “dns” tab in the cloudflare dashboard.

Cloudflare DNS only

Cloudflare DNS only

Check Your WordPress Site Settings

Another thing to check is your wordpress site settings. there are two different fields that you’ll want to make sure are set correctly and aren’t pointing to the wrong domain or mismatching. Another common mistake is that you are not using the correct prefix to match the rest of your site, www or non-www. sometimes people migrate hosts or change domains and these can change without you even realizing it.

  • wordpress address (url): the address to reach your blog.
  • site address (url): the address of your main wordpress files.

both should match unless you’re giving wordpress its own directory.

WordPress address

WordPress address

Most likely though you aren’t able to access your WordPress dashboard. So what you can do is override the settings above by inputting the values in your wp-config.php file.

The wp-config.php file is usually located at the root of your wordpress site and can be accessed via ftp, ssh, or wp-cli. To encode wp_home and wp_siteurl, simply enter the following code towards the top of the file, changing the values ​​to reflect your domain.

Below is an example of what your wp-config.php file would look like afterwards.

  • change wordpress url directly in database
  • change wordpress url with wp-cli

once you configure it manually, you can navigate to your site to check whether or not it fixes the redirect loop.

multisite

If you’re switching domains on a multiple site, be sure to check the wp_blogs table as well. we’ve seen people do a search and replace incorrectly and cause an infinite redirect loop. this is because the network site does not match the subsites.

wp_#_options – Each subsite will have table sets that correspond to the blog_id in the wp_blogs table. go to the wp_#_options table, where # is blog_id, and update the “siteurl” and “home” settings in that table.

See Also:  Does priority mail delivery on martin luther king day

temporarily disable wordpress plugins

when it comes to wordpress, temporarily disabling all your wordpress plugins can be a quick way to spot problems. For example, plugins like redirect or yoast seo premium allow you to implement redirects. Sometimes settings or updates to these plugins can conflict with redirects that may already be configured on your server, causing a redirect loop.

Remember, you won’t lose any data if you simply disable a plugin. most likely you will not be able to access the wordpress admin so you will need to login via sftp to your server and rename your plugins folder to something like plugins_old. then check your site again.

SFTP rename plugins folder

SFTP rename plugins folder

If it works, then you will need to test each plugin one by one. Rename your plugin folder back to “plugins” and then rename each plugin folder inside of if it, one by one, until you find it. You could also try to replicate this on a staging site first.

Rename plugin folder

Rename plugin folder

Check Redirects on Your Server

In addition to the http to https redirects on your server, it might be good to check and make sure there aren’t any additional misconfigured redirects. for example, a bad 301 redirect to yourself could take your site down. these are usually found in your server’s configuration files.

apache .htaccess file

kinsta only uses nginx, but if you’re using a wordpress host running apache, there’s a good chance your .htaccess file has the wrong rule. follow the steps below to recreate a new one from scratch.

first, login to your site via ftp or ssh and rename your .htaccess file to .htaccess_old. this ensures that you have a backup.

Rename .htaccess file

Rename .htaccess file

Normally to recreate this file you can simply re-save your permalinks in WordPress. However, if you’re in the middle of an ERR_TOO_MANY_REDIRECTS error you most likely can’t access your WordPress admin, so this isn’t an option. Therefore you can create a new .htaccess file and input the following contents. Then upload it to your server. The following uses the default settings.

see the wordpress codex for more examples, such as a default .htaccess file for multisite.

We’ve taken our knowledge of effective large-scale website management and turned it into an ebook and video course. Click here to download the 2020 guide to managing 40+ wordpress sites!

nginx configuration

If your host uses nginx, this file can be a bit more complicated as the configuration file can vary a bit depending on the hosting provider. we recommend that you contact your host and ask them to check your config file for anything that might be causing a redirect loop or too many redirects.

If you’re a kinsta customer, you’ll first want to make sure you haven’t set up the wrong redirect in our redirect tool. Here’s a simple example of a redirect from https://domain.com/ to itself, which would cause a redirect loop.

Bad 301 redirect

Bad 301 redirect

This also commonly happens when the location URL is included in both “Redirect From” and “Redirection To.”

for example, the following would cause a redirect loop:

redirect from: ^/blog/about redirect to: https://domain.com/blog/about-me

why? because once the process got to ^/blog/about, the remaining -me part wouldn’t care and would cause an infinite loop. you must specify the end of the string and the starting point. This is what I would do to fix it:

redirect from: ^/blog/about$ redirect to: https://domain.com/blog/about-me

the $ character will tell nginx to stop and match the request only if the string is exactly there, but nothing after that.

and of course you can always open a support ticket and we’ll review it for you.

misconfigured reverse proxies

Another common reason for the err_too_many_redirects error is if you are using a reverse proxy. Reverse proxies can be quite tricky and it is very easy to send your WordPress site into a redirect loop if it is misconfigured. again, if you’re a kinsta customer, our support team can help you with this.

summary

redirect loops can sometimes be difficult to trace. but hopefully some of the troubleshooting steps above will help you resolve your err_too_many_redirects error. If we missed something, feel free to let us know below in the comments.

Leave a Reply

Your email address will not be published. Required fields are marked *