Table of Contents
Last update on
WordPress makes it super easy to create and edit websites, even with little to no web development skills. If you’re not familiar with the technical aspects of WordPress and web servers, it’s easy to misconfigure their settings.
The ERR_TOO_MANY_REDIRECTS
error is one of the most common error messages faced by WordPress users. It’s also called a “redirect loop” error, wherein the browser can’t figure out which URL to load. There are several reasons that can cause this error, but there’s no need to panic. It’s easily solvable by diagnosing the cause and fixing it.
In this article, I’ll explain what’s a redirect loop, and then take you through a step-by-step process of getting your WordPress site running perfectly in no time.
Excited? Let’s dig in!
What Is “ERR_TOO_MANY_REDIRECTS” Error?
When you enter a URL in the browser, say apples.com, the browser resolves its DNS and connects to the IP address of the server hosting this domain. The server then sends all the relevant resources (e.g. HTML, CSS, JS) to the browser, which then assembles them and displays it to the user. It works similarly for URLs with subdirectories.
If you want to change the domain name of your website, say oranges.com, then you need to maintain backwards compatibility for users and search engines. The recommended way to redirect the old URL to the new one by sending the browser a 301 Moved Permanently HTTP response.
Most times, the redirection isn’t from one root domain to another, but to different pages within the same root domain. For example, redirecting a browser from apples.com/offers to apples.com/discounts.
The ERR_TOO_MANY_REDIRECTS
error occurs when the browser redirects from URL A to URL B, and then again from URL B to URL A, which again redirects to URL B, and so on and so forth. The browser recognizes this infinite redirect loop and throws up an error.
Reasons for ERR_TOO_MANY_REDIRECTS Error
There are many causes for this redirect loop error. For a WordPress website, here are the prime culprits:
- Misconfigured WordPress settings
- Improper server settings (e.g. .htaccess file)
- Conflicting WordPress plugin settings
- Misconfigured SSL/TLS certificate (HTTPS settings)
- Issues with third-party services (e.g. CDNs)
- Hosting multiple websites on the same server
- Migrating the website or domains improperly
Now that you’ve learned what may cause the ERR_TOO_MANY_REDIRECTS error, it’s time to learn how to fix it.
How to Fix “ERR_TOO_MANY_REDIRECTS” Error
It’s best to go about solving this problem in a step-by-step manner, starting from the most common reasons. Hence, I’ve sorted the solutions according to that. However, if you started getting this error after making some changes on your website or your server, you can skip to the section which fits your previous actions the best.
Clear Your Browser’s Cookies
Most websites store cookies in your browser to enhance and streamline user experience. Sometimes these cookies may contain faulty or obsolete data, which can lead to a redirect error.
Clearing your browser’s cookies will eliminate this possibility. You can try this solution if you’re facing redirect loop errors on someone else’s sites, too.
You can find the option to clear cookies in your browser’s Settings or Options page, under the Privacy or History section.
This setting may vary from one browser to another, so you can follow Lifewire’s guide on how to delete cookies in every major browser.
WordPress URL Settings
WordPress allows you to power the root domain from a subdirectory. For instance, you can have WordPress installed in a subdirectory example.com/wordpress and use it to serve the root domain example.com. This avoids cluttering up your server’s root directory.
To define this, go to the Settings > General panel in your WordPress admin dashboard and enter the WordPress Address (URL) and Site Address (URL) values.
The Site Address URL is what users type in their browsers to visit your website. The WordPress Address URL is where you’ve installed WordPress in your server. Only admins and users with backend access can see the WordPress Address.
For most WordPress sites, these entries should remain identical. However, mistakes do happen.
To fix this, go to your WordPress admin dashboard and edit these URL fields to be identical. Pay attention to not just the domain name, but also the HTTP vs HTTPS, and www vs www parts of the URL.
Sometimes, you cannot access your WordPress dashboard because of the redirect loop. You can change the same settings directly by editing your wp-config.php file and defining the URL values of the following two WordPress constants.
define('WP_HOME','https://example.com');
define('WP_SITEURL','https://example.com');
Tip: You can pinpoint the exact cause of the redirect loop by using free online tools such as HTTP Status Code Checker, Redirect mapper, and Redirect Checker.
Misconfigured HTTPS Settings
Installing an SSL/TLS certificate for your WordPress site is one of the primary ways to secure your site and your users. It’s so crucial that it’s not an option anymore, but a requirement by many browsers.
However, if you set your site to load over HTTPS without installing and configuring an SSL/TLS certificate properly, it can lead to a redirect loop as the browser cannot negotiate the HTTPS connection with the server.
You can use the SSL Server Test by Qualys SSL Labs to analyze whether you’ve configured your web server to negotiate connections over HTTPS properly.
If you’ve installed an SSL WordPress plugin, then make sure you’ve set it up properly. While they make it easy to redirect all of your site’s URLs to HTTPS automatically, they can sometimes conflict with your server settings. Hence, it’s always recommended configuring your server settings manually.
Tip: If tweaking your server’s settings is too daunting for you, contact your hosting provider’s support team to get help with setting up the SSL/TSL certificate.
Flush All Caches
Redirect loops caused by server responses can be cached. So, even if you’ve fixed the problem, the cache won’t reflect the changes.
Hence, clear all caches after making any changes to the site or the server. That includes caches on the server, WordPress site, any third-party services (e.g. CDN, WAF), and even your browser.
If you’re using WP Rocket, you can easily clear cache by going to Settings > WP Rocket > Dashboard panel and clicking the Clear Cache button.
Clearing your server cache depends on the type of hosting provider you have. Typically, managed WordPress hosts give you an easy one-click option to clear the server cache. Third-party services like Cloudflare and Sucuri also provide you with a simple way to purge cache.
Finally, you can try clearing your browser cache.
Temporarily Disable WordPress Plugins
WordPress plugins can sometimes interfere with the functioning of redirection rules set up by WordPress or the server. This is especially true if you have any redirection plugins installed. You can try deactivating them temporarily.
Some SEO plugins like Yoast SEO Premium also let you set redirections on a page-by-page basis, so you can disable them temporarily too if you suspect that they’re a problem.
You should note that just deactivating a plugin doesn’t delete the plugin or any data related to it. You’ll still be able to restore your redirection rules and SEO meta tags later.
If you can’t access your WordPress admin dashboard to deactivate the plugins, then you can disable them by renaming the plugin’s folder name in your wp-content/plugin directory.
I suggest you to deactivate plugins one by one to find out which plugin is causing the problem, if at all you find one. This will make it easier for you to restore all the other plugins later.
Wrong CDN or WAF Configuration
Third-party services such as CDNs (e.g. Cloudflare) and WAFs (e.g. Sucuri) are reverse proxies that sit between your server and the clients. Configuring reverse proxies to work properly with WordPress can be a little complicated if you’re not familiar with how they work.
If the reverse proxy also handles your SSL/TLS certificates, it only adds to the complexity. It’s easy to change their settings such that your site goes into an infinite redirect loop. Hence, configure them properly by taking the help of your host’s support team or a professional web developer.
Misconfigured Server settings
Finally, check your server config files to ensure that there aren’t any unnecessary redirection rules. WordPress sites mostly run on two types of web servers: Apache or NGINX.
If your WordPress site is powered by Apache web server, then you need to look into your site’s root directory to find the .htaccess file. Here’s the basic .htaccess file configuration for WordPress sites:
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
You can find many more examples of how you can set up your .htaccess file properly in the WordPress Codex.
Configuring NGINX is more complex as it requires you to access the terminal in most cases. You can refer to DigitalOcean’s NGINX redirects tutorial to get started.
Wrapping Up
Learning how to use redirects properly will help you modify your site structure without harming your site’s SEO or user experience. From forcing secure SSL connections to ensuring that your visitors end up on the right page, HTTP redirects have many uses.
Coming across the ERR_TOO_MANY_REDIRECTS
error is far too common for most WordPress site owners. You now have the knowledge to diagnose the causes for this redirect loop error and fix it by using various techniques.
If you still have doubts about how to solve the ERR_TOO_MANY_REDIRECTS
error, please leave a comment below!