How to Solve ERR_TOO_MANY_REDIRECTS Error on WordPress

by | Last Updated Jan 21, 2021 | WordPress | 0 comments

WordPress users often see the error ERR_TOO_MANY_REDIRECTS.

Typically this happens after a recent WordPress change. Another cause of this error is incorrect server configuration or incorrect settings with third-party services.

Don’t worry; we can quickly fix it.

You can fix this error and get your site up and running by following the instructions below.

What Is ERR_TOO_MANY_REDIRECTS?

ERR_TOO_MANY_REDIRECTS means what it sounds like. Something is causing your website to automatically redirect too many times, creating an infinite redirection loop.

Nearly the site has stopped working. And unlike any other errors, these usually will not resolve themselves alone; you will have to fix it on your own.

An example is URL 1 pointing to URL 2 and URL 2 pointing back to URL 1. You see the infinite loop here, don’t you?

The error can appear in a few different variations, depending upon which browser you are using.

Google Chrome

Google Chrome displays this error as below.

ERR_TOO_MANY_REDIRECTS in Google Chrome

This page isn’t working. www.dademo2020.xyz redirected you too many times. Try clearing your cookies. ERR_TOO_MANY_REDIRECTS.

Mozilla Firefox

Mozilla Firefox displays this error as below.

ERR_TOO_MANY_REDIRECTS in Mozilla Firefox

The page isn’t redirecting properly. An error occurred during a connection to www.dademo2020.xyz. This problem can sometimes be caused by disabling or refusing to accept cookies.

Microsoft Edge

Microsoft Edge displays this error as below.

ERR_TOO_MANY_REDIRECTS in Microsoft Edge

This page isn’t working at the moment. dademo2020.xyz redirected you too many times. To fix this issue, try clearing your cookies. ERR_TOO_MANY_REDIRECTS.

Here are some simple steps you can follow to fix the error. They are sorted based on the most frequent reasons we see.

Delete Cookies From That Specific Website

Google Chrome and Microsoft Edge recommend you try clearing your cookies right below the error message.

Sometimes cookies may contain incorrect data that can lead to the ERR_TOO_MANY_REDIRECTS error. Even if the error is on a site you don’t own, you can try this recommendation.

Because cookies keep your logged in status on sites, we recommend that you delete the cookie(s) on the site giving you trouble.

This way, your other sessions or websites that you frequently visit will remain unaffected.

Follow these steps in Google Chrome to delete cookies on a specific website.

Click the three small dots on the top right corner of Google Chrome.

Chrome Settings Menu

Next, click Settings.

Now scroll down a bit until you see the Privacy and Security section.

Privacy and Security Section in Chrome

Click on Cookies and other site data there.

Now click on See all cookies and site data.

On the new screen, you will find all the domains you visited.

Delete Cookies and Site Data in Chrome

Find the domain where you encountered the ERR_TOO_MANY_REDIRECTS error. You can then delete cookies for that domain currently stored on your computer. Then try revisiting the site.

Clear WordPress Cache, Proxy Cache, and Browser Cache

Your caching system will cache the redirect loops responses. So, clearing your WordPress site’s cache is always recommended when experiencing redirect loops.

If necessary, you can also remove cache from third-party proxy services or even from your browser.

Clear Your WordPress Site Cache

You may still be able to access your WordPress admin dashboard, depending on the type of redirect loop. In that case, you can use your caching plugin’s settings to clear the cache quickly.

LiteSpeed Cache Purge All

If you are using LiteSpeed Cache, just hit the Purge All link under the LiteSpeed Cache icon.

Remove Proxy Cache

Suppose you are using a reverse proxy such as Cloudflare. In that case, you may want to clear the cache on their side.

Log in to the Cloudflare dashboard to purge the Cloudflare cache.

Cloudflare Purge Everything

Then click into the Caching tab and click on the Purge Everything button.

Clear Your Browser Cache

You can open up your browser in incognito mode without clearing your cache. This will allow you to determine whether the problem lies in your browser cache.

You may also try another browser and see if the ERR_TOO_MANY_REDIRECTS error still occurs.

If you determine your browser cache is causing it, you can then clear it.

Most of the browsers will clear the cache if you use Ctrl + Shift + Delete keys.

Identify the Nature of the Redirect Loop

If clearing the cache didn’t work, the next step is to figure out why the redirect loop is happening. The free online Redirect Checker tool provides further information about what might be going on.

Redirect Checker Tool

In this example, the tool says that Exceeded maximum number of redirects as the Error message.

The Redirect Path Chrome extension can also be handy and provides detailed information about how redirects are happening on your website.

Redirect Path Chrome Extension

Check Your HTTPS Configuration

You should also check your HTTPS settings. Many times, I’ve seen ERR_TOO_MANY_REDIRECTS appear after someone migrates from HTTP to HTTPS. Either they didn’t finish the process, or they set up something incorrectly.

Don’t Enforce HTTPS Without a Valid SSL Certificate

This is by far the most frequent reason we see.

Let’s say you force your WordPress site to load over HTTPS without first installing an SSL certificate. In that case, you’ll immediately produce a redirection loop on your site.

You can fix this issue by installing an SSL certificate on your WordPress website.

We also recommend running an SSL check just after you installed the SSL Certificates.

Qualys SSL Labs provides a free tool for SSL testing. It is very reliable, and Rovity uses it when verifying certificates for all of our clients.

Navigate to their SSL check tool, input your domain name in the Hostname field and click the Submit button.

The option to hide public results is also available if you desire. The SSL/TLS configuration on the web server could take a few minutes to scan.

Dademo2020 SSL Lab Test

Update Your Hard-Coded Links Instead of Using an SSL Plugin

A few SSL WordPress plugins, available for free, will help you automatically redirect visitors to HTTPS. However, this method should not be used as a permanent solution.

Likely, these third-party plugins will always introduce new problems and compatibility issues. That’s a good temporary fix, but I would recommend updating your hard-coded HTTP links.

Don’t you know how to do this without committing any mistakes? Don’t worry. Our support team can also handle this task for you if you’re a Rovity client.

Check HTTP to HTTPS Redirection on the server

It could be that the HTTPS redirect rules on your server are incorrectly configured.

HTTP Redirection to HTTPS in Apache or LiteSpeed Web Server

Suppose you’re running an Apache webserver. In that case, you can easily redirect all your HTTP traffic to HTTPS by including the following code in your .htaccess file.

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

Since the LiteSpeed web server is a drop-in Apache replacement, you can use the same code in your LiteSpeed setup.

At Rovity, we use LiteSpeed Web Server.

Check HTTP to HTTPS Redirection in DirectAdmin

Rovity uses DirectAdmin as its control panel. In DirectAdmin, you can enable or disable redirections separately.

Log in to your DirectAdmin account. Then click on the Domain Setup icon.

DirectAdmin will list all your domains there.

Click on the domain that you are experiencing ERR_TOO_MANY_REDIRECTS error.

Force Redirect in DirectAdmin

On the modify domain page, you will see the Force redirect dropdown.

Depending on your website configuration, select the value from this dropdown. No redirection is the default option.

Check Your Third-Party Services

Reverse proxy services such as Cloudflare can also frequently cause the ERR_TOO_MANY_REDIRECTS error. Usually, this occurs when their Flexible SSL option is enabled. Still, you already have an SSL certificate installed with your hosting company.

Why?

The reason is that all requests for your origin server are sent through HTTP when flexible is selected. Your host server probably already redirects you from HTTP to HTTPS, leading to a redirect loop.

Cloudflare SSL Full Strict

Cloudflare SSL/TLS settings should be set from Flexible to Full or Full (strict) to fix this issue. If Rovity hosts your websites, be sure to check out the steps for installing A+ graded SSL certificates.

You can switch all URLs to HTTPS without generating a loop by using the Always Use HTTPS page rule.

To enable the Always Use HTTPS option in your Cloudflare account, open the SSL/TLS page. Then open the Edge Certificates tab.

Scroll down a bit, and you will see Always Use HTTPS. Now toggle this to On.

Using Cloudflare for DNS Only

If you utilize Cloudflare’s DNS without using their proxy/WAF features, make sure DNS records are set to DNS Only.

Instead of orange, the Cloudflare clouds will appear gray. You can configure these DNS settings within the Cloudflare control panel.

Review Your WordPress Website Settings

You should also review your WordPress site’s settings. It is crucial to make sure two fields are set correctly and not mismatched or pointing to the wrong domain.

Another common mistake is not using the correct DNS prefix combined with your site, either www or non-www. Sometimes people change hosts or change domains, and these things can show up as changes without you recognizing them.

  • WordPress Address (URL): This is where you’ll find all the admin pages for WordPress. It’s the place your WordPress site’s code lives.
  • Site Address (URL): This is what visitors see when they come to your site. It’s where people go and what you write on your business card.

Unless WordPress has its separate directory, both directories should match.

WordPress Address URL

Almost certainly, though, you cannot access your WordPress dashboard. You can override the settings above by adding the values to the database.

To change the WordPress URLs, log in to your DirectAdmin control panel.

Then click on the MySQL Management icon under the Account Manager category.

You will see your databases listed there.

DirectAdmin Login to phpMyAdmin

Click on the + icon against your database name and then click on the Login to phpMyAdmin link.

Now, you are logged in to the phpMyAdmin software.

Click on the database in phpMyAdmin on the left-hand side. Next, click on the wp_options table.

The database might be named differently depending on the database prefix, such as wp19_options.

WordPress Change SiteURL in Database

Then locate the siteurl and home fields.

Double-click in the value option (for each option) and enter the new URL.

phpMyAdmin will automatically save your changes.

After setting it manually, you can verify whether the redirect loop is fixed by visiting your site.

Disable WordPress Plugins Temporarily

In WordPress, temporarily disabling all plugins can help you to diagnose problems quickly.

The Rank Math Premium plugin, for example, allows you to implement redirects. Setting up these plugins or updating them can sometimes conflict with redirects that might already be set on your server. This will create a redirect loop.
.
Moreover, if you disable a plugin, you will not lose any data.

Probably you cannot access the WordPress admin, so you need to log in via SFTP. You can also use File Manager from your DirectAdmin account.

WordPress Rename Plugins Folder in DirectAdmin

Now rename your plugins folder to something like plugins_old from your wp-content folder. Then recheck your site.

If it works, then you’ll need to test each plugin individually.

Rename your plugins_old folder back to plugins.

Then, rename each plugin folder inside of it one at a time until you find the plugin makes this trouble.

Check for Redirects on Your Server

In addition to HTTP to HTTPS redirects on your server, it can be a good idea to double-check any additional redirects that have been set up incorrectly.

One bad 301 redirect back to itself could take down your site, for example. Usually, you’ll find these in your server’s config files.

The .htaccess File (Apache and LiteSpeed)

If you use a WordPress host that runs Apache or LiteSpeed, your .htaccess file may have a wrong rule in it. Follow the instructions below to create a new .htaccess file from scratch.

First, you need to log into your site via SFTP or SSH, then rename the .htaccess file to .htaccess_old. This ensures you always have a backup.

In most cases, you can recreate this file by re-saving your permalinks settings in WordPress. However, you won’t be able to access your WordPress admin if you’re going through ERR_TOO_MANY_REDIRECTS, so this isn’t an option.

Therefore, you should create a new .htaccess file and add the following content. You can then upload it to your server. These settings are default settings.

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

Alternatively, you can access File Manager in your DirectAdmin account. From there, you can edit your .htaccess file directly and save it.

Reverse Proxy Misconfiguration

The error ERR_TOO_MANY_REDIRECTS may also arise from the incorrect reverse proxy configuration. Reverse proxies are quite complex, and if misconfigured, they can easily lead to a redirect loop on your WordPress site.

Summary

Sometimes redirect loops can be challenging to spot. However, I hope that some of the troubleshooting steps above helped you fix the ERR_TOO_MANY_REDIRECTS error.

Feel free to let us know if we missed anything in the comments below.

We engineered our cloud infrastructure with Performance, Speed, Scalability, and Security in mind.

That’s why we built Rovity with AWS, CloudLinux OS, DirectAdmin, and LiteSpeed Web Server.

Come and experience the next generation of shared hosting on the cloud

By Jafar Muhammed

Jafar Muhammed has 10+ years of experience in WordPress, web hosting, domain names, DNS, CDN, server administration, etc. He is an open web advocate. He is the CEO of Rovity, the fastest growing premium shared hosting startup in India.

Check Out These Related Posts

Avoid These 8 Blogging Mistakes in 2021

Avoid These 8 Blogging Mistakes in 2021

Blogging plays a large part in the $400 billion content marketing industry. Blogs are an excellent way to make substantial extra income. They're also powerful tools for generating traffic to your website. Blogging isn't just a part-time gig and a digital marketing...

read more
How to Add HTTP Security Headers in WordPress

How to Add HTTP Security Headers in WordPress

Would you like to add HTTP security headers to your WordPress website? With HTTP security headers, your WordPress website will have an extra layer of protection. This will prevent malicious activity from affecting your website performance. The tutorial below will walk...

read more

0 Comments

0 Comments

Submit a Comment

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