Home How To How to Resolve ERR_TOO_MANY_REDIRECTS in WordPress

How to Resolve ERR_TOO_MANY_REDIRECTS in WordPress

452
ERR_TOO_MANY_REDIRECTS

We see a lot of different problems here, and one of the most common is ERR_TOO_MANY_REDIRECTS (also known as a redirect loop). This frequently occurs as a result of a recent WordPress site change, a server redirection misconfiguration, or erroneous third-party service settings. But don’t worry, this is a straightforward issue to resolve.

Check out the tips below on how to fix this mistake and get your site up and running again.

What is the ERR_TOO_MANY_REDIRECTS Error?

The source of ERR_TOO_MANY_REDIRECTS is precisely what it sounds like something is generating an excessive number of redirects on your website, resulting in an endless redirection cycle.

Essentially, the site is stuck (for example, if URL 1 points to URL 2 and URL 2 points back to URL 1, or if the domain has redirected you too many times), and unlike some other problems, this one seldom resolves itself and will almost certainly require you to take action to correct it.

Depending on the browser you’re using, there are a few distinct variations of this issue.

Read More:- 9 Tips to Fix the ERR_CONNECTION_REFUSED Error in Chrome

Google Chrome

ERR_TOO_MANY_REDIRECTS

This error will appear as ERR_TOO_MANY_REDIRECTS (as seen below) or This webpage has a redirect loop problem in Google Chrome.

This page is not accessible. You were forwarded too many times by domain.com.

Mozilla Firefox

The website is not correctly redesigned on Mozilla Firefox (as seen below).

During the connection to domain.com, an issue occurred. Disabling or refusing to accept cookies might sometimes create this issue.

Microsoft Edge

It will simply appear as in Microsoft Edge. This page is currently unavailable (as seen below). You were forwarded too many times by Domain.com.

Safari

Safari will display the message “Safari Can’t Open the Page” (as seen below).

Attempting to open “domain.com” resulted in an excessive number of redirections. If you open a page, that is redirected to the original page, it may take place.

Here are a few suggestions to check to correct the mistake (sorted in order by most common reasons we see):

Delete Cookies on That Specific Site

Both Google and Mozilla advise “try deleting your cookies” directly underneath the issue. The ERR_TOO_MANY_REDIRECTS issue can sometimes be caused by erroneous data in cookies. Even if you’re getting the problem on a site you don’t own, you can try this suggestion.

We propose removing the cookie(s) on the site that is having the difficulty because cookies keep your “logged in” status on sites and other settings. In this manner, none of your other sessions or frequently visited websites will be harmed.

To erase a cookie on a specific website in Google Chrome, follow the steps below.

Step#1 – Click the three little dots in the upper right-hand corner of Google Chrome. Then select “Settings.”

ERR_TOO_MANY_REDIRECTS

Step#2 – Go to the bottom of the page and select “Advanced.”

ERR_TOO_MANY_REDIRECTS

Step#3 – Next, select “Content settings.”

ERR_TOO_MANY_REDIRECTS

Step#4 – Select “Cookies” from the drop-down menu.

ERR_TOO_MANY_REDIRECTS

Step#5 – Next, select “View all cookies and site data.”

ERR_TOO_MANY_REDIRECTS

Step#6 – Look for the site (domain) where the ERR TOO MANY REDIRECTS issue is occurring. The cookie(s) currently stored on your computer for that domain can then be deleted. Then go back to the webpage and try again.

ERR_TOO_MANY_REDIRECTS

Clear Server, Proxy, and Browser Cache

Because redirect loops are cached replies, it’s always a good idea to clean the cache on your WordPress site, the server, third-party proxy services, and even your browser if necessary.

Clear WordPress Site Cache

You may still be able to access your WordPress admin panel depending on the type of redirect loop. In this scenario, you may quickly erase the cache in your caching plugin’s settings:

Clear Server Cache

Many WordPress servers have their control panel tools for clearing the cache on your WordPress site if you can’t access WordPress admin.

Clear Proxy Cache

It’s also a good idea to delete the cache on any third-party reverse proxy services you’re utilizing, such as Cloudflare or Sucuri.

Cloudflare

To clear Cloudflare’s cache, go to their dashboard, select “Caching” and then “Purge Everything.”

ERR_TOO_MANY_REDIRECTS

Sucuri

To clear Sucuri’s cache, go to their dashboard, select “Performance” and then “Clear Cache

ERR_TOO_MANY_REDIRECTS

Clear Browser Cache

You can always open your browser in incognito mode to test if it’s your browser cache without clearing it. Alternatively, try using a different browser to check whether the ERR_TOO_MANY_REDIRECTS problem persists.

ERR_TOO_MANY_REDIRECTS

Determine the Nature of the Redirect Loop

If emptying the cache doesn’t solve the problem, try to figure out what’s causing the redirect loop. This free online Redirect Checker application can help you research what’s going on. This might be done using cURL as well.

The site below, for example, has a 301 redirect loop back to itself, resulting in a massive chain of erroneous redirects. You may trace all of the redirects to see if it’s looping back to itself, or if it’s an HTTP to HTTPS loop, which we’ll cover how to resolve further down.

ERR_TOO_MANY_REDIRECTS

The Redirect Path Chrome extension is also quite handy, as it gives you an overview of all of your site’s redirection.

ERR_TOO_MANY_REDIRECTS

Check Your HTTPS Settings

You could also double-check your HTTPS settings. We’ve noticed ERR TOO MANY REDIRECTS a lot when people have just finished migrating their WordPress site to HTTPS and either didn’t finish or set things up improperly.

1. Don’t Force HTTPS Without an SSL Certificate

By far the most prevalent reason we encounter regularly. You’ll instantly throw your WordPress site into a redirection loop if you force it to load over HTTPS without first installing an SSL certificate. To remedy this, just install an SSL certificate on your WordPress site.

It’s also a good idea to check your SSL certificate. SSL/TLS certificates necessitate the installation of intermediate certificates in addition to your main certificate (chains). These must be correctly set up.

We recommend utilizing Qualys SSL Labs’ free SSL check tool. It is quite dependable. Just enter your domain in the hostname area by visiting your SSL checker and by clicking on “Send“. If you like, you can also choose to conceal public results. Scanning your site’s SSL/TLS settings on your web server may take a minute or two.

ERR_TOO_MANY_REDIRECTS

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

There are a few free SSL WordPress plugins available, such as the Simple SSL plugin, that will assist you in redirecting to HTTPS automatically. However, because third-party plugins can always create another layer of complications and compatibility issues, we don’t suggest this strategy as a long-term solution. It’s a good workaround for the time being, but you should alter your hard-coded HTTP links.

3. Check HTTP to HTTPS Redirects on the Server

Your server’s HTTPS redirect rules may be incorrectly configured.

Redirect HTTP to HTTPS in Nginx

When your webserver runs Nginx, you’ll effortlessly switch all HTTP traffic to HTTPS by adding the following code to your Nginx config file. The WordPress routing approach on Nginx is recommended.

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

Redirect HTTP to HTTPS in Apache

If your web server is running Apache, you can quickly redirect all HTTP traffic to HTTPS by editing your .htaccess file with the following code. This is the strategy proposed to redirect WordPress to Apache.

RewriteEngine On

RewriteCond %{HTTPS} off

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

4. Check For Too Many HTTPS Redirects

Perhaps you have an excessive number of HTTPS redirects. With Patrick Sexton’s Redirect mapper tool, you can simply check how many redirects your site uses. Here’s an example of wrongly configured redirects that the redirect mapper may quickly detect. On both the www and non-www versions, you can see that there are redundant HTTPS redirects.

ERR_TOO_MANY_REDIRECTS

Check Third-Party Services

Reverse-proxy services like Cloudflare are also a prevalent source of ERR TOO MANY REDIRECTS. This happens when you have their flexible SSL option activated and your WordPress host has already configured your SSL certificate. Why? Due to the flexibility of the hosting server, all queries are sent via HTTP. A redirect loop arises because your host server most likely already has an HTTP to HTTPS redirect in place.

To correct this, you must adjust the Cloudflare Crypto configuration from full (strict). Check out our instructions for installing an SSL certificate while utilizing Cloudflare.

ERR_TOO_MANY_REDIRECTS

You can use their Always Use HTTPS page rule to avoid a loop by redirecting all users to HTTPS. Cloudflare’s forwarding URL redirection rules are another item to keep an eye on. Don’t make a realignment to the destination of the domain. This may lead to an infinite error that cannot resolve the affected URLs.

When using StackPath, ensure that only HTTPS is set to the “Origin Pull Protocol” option.

Using Cloudflare DNS Only

Make sure your DNS records are set to “DNS Only” if you only want to use Cloudflare’s DNS and not their proxy/WAF service. Instead of seeming “orange,” the clouds will appear “grey.” This is configured on the Cloudflare management panel’s “DNS” tab.

ERR_TOO_MANY_REDIRECTS

Check Your WordPress Site Settings

Another thing to look at is the settings on your WordPress site. Check sure two fields are set correctly and aren’t pointing to the wrong domain or are mismatched. Another usual gaffe, whether www or not, does not match the rest of your website using the correct prefix. These parameters can be changed without your knowledge when users move hosts or change domains.

  • WordPress Address (URL): Your blog address to reach.
  • Site Address (URL): Your WordPress core file address.

ERR_TOO_MANY_REDIRECTS

However, you are most likely unable to access your WordPress dashboard. By adding the values to your wp-config.php file, you can override the above settings.

The wp-config.php file can be found at the root of your WordPress installation and accessed through FTP, SSH, or WP-CLI. Simply add the following code to the start of the file to hard-code WP_HOME and WP_SITEURL, updating the values to reflect your domain.

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

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

An example of what your wp-config.php file might look like after that is shown below.

ERR_TOO_MANY_REDIRECTS

After you’ve manually set it, go to your site to see if the redirect loop has been resolved.

Multisite

Check the WP blogs table as well if you’re transferring domains on a multisite. We saw people searching and substituting blunders, which led to an endless reroute loop. This is because the network site does not correspond to the subsites.

wp_#_options: Each subsite will have a set of tables that correlate to the wp_blogs table’s blog_id. Make changes to the “siteurl” and “HOME” settings in the wp_#_options table, where_#_refers to the blog id.

Temporarily Disable WordPress Plugins

When it comes to WordPress, temporarily disabling all of your plugins can help you discover issues quickly. Redirects can be implemented using plugins like Redirection or Yoast SEO Premium. Setting or updating these plugins might sometimes cause redirect loops by interfering with redirects already in place on your server.

Remember that just disabling a plugin will not result in any data loss. If you cannot access WordPress admin, connect to your server by SFTP and rename your plugin folder to something like the old plugin. Check your website twice thereafter.

If it works, you’ll need to test each plugin individually. Rename your plugin folder to “plugins” and then rename each plugin folder inside it until you discover it. You might also attempt to recreate this first on a test site.

Check Redirects on Your Server

Aside from HTTP to HTTPS redirects on your server, it’s a good idea to double-check that there aren’t any other redirects set up incorrectly. For example, a terrible 301 can bring your site offline. These are usually located in the config files of your server.

Apache .htaccess file

Many people use Nginx, however, if you’re using an Apache-based WordPress host, your .htaccess file may have an incorrect rule. To make a new one from scratch, follow the steps below.

Rename your .htaccess file to .htaccess_old after logging into your site via FTP or SSH. As a result, you’ll have a backup.

ERR_TOO_MANY_REDIRECTS

Normally, you can just re-save your permalinks in WordPress to rebuild this file. If you’re experiencing an ERR_TOO_MANY_REDIRECTS issue, you won’t be able to reach your WordPress admin panel, therefore this isn’t an option. As a result, you can build a new .htaccess file with the contents listed below. Then you’ll need to upload it to your server. The following examples make use of the default parameters.

# 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

Nginx Config

This file can be a little difficult if your host utilizes Nginx because the config file varies based on the hosting company. We recommend contacting your server and having them look over your config file for anything that could be generating a redirect loop or excessive redirects.

First, double-check that you didn’t put up a redirect in our redirect tool incorrectly. A redirect loop would be caused by a redirect from https://domain.com/ back to itself, as shown below.

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? Once the procedure got to ^/blog/about, the remaining half -me would be irrelevant, resulting in an endless loop. You must define the string’s end and beginning points. Here’s how you’d go about fixing that:

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 there exactly, but nothing after it.

And of course, you can always open up a support ticket and we’ll check this for you.

Misconfigured Reverse Proxies

If you’re utilizing a reverse proxy, another typical cause of the ERR_TOO_MANY_REDIRECTS issue is that you’re employing one. Reverse proxies are difficult, and if installed incorrectly, it’s very easy to send your WordPress site into a redirect loop.

Summary

It can be difficult to trace down redirect loops. However, you should be able to remedy your ERR_TOO_MANY_REDIRECTS problem by following some of the troubleshooting procedures outlined above. Please let us know if we missed anything in the comments section below.