What is and how to fix the ERR_TOO_MANY_REDIRECTS error

What is and how to fix the ERR_TOO_MANY_REDIRECTS error

It is likely that while browsing the internet or even on your own website, you may have encountered an ERR_TOO_MANY_REDIRECTS message indicating that there are too many redirects to complete the connection. The error usually looks like this:
 
 
This happens because the site redirects you too many times. When redirects occur in a loop, the browser or web server will attempt to break the loop and return an error page. A loop means you try to go to A, where A sends you to B, but B sends you back to A again, and so on.
 
This happens because somewhere in your code, files, or configurations there is more than one redirect command conflicting with each other. A common mistake is a redirect from www.example.com to example.com, but elsewhere it states the opposite. This will create a redirect loop.
 
An HTTP to HTTPS loop, or vice versa, is also very common.
 
If you access your hosting error logs (Where to view hosting error logs) an error similar to the following will be recorded:
 
AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace
 
How to fix the ERR_TOO_MANY_REDIRECTS error?
As mentioned initially, this error is due to your website’s configuration/code, so there may be several sections or files generating the issue.
 
Clear browser cookies and cache
 
One reason this error may appear is that your browser cache and cookies store old redirects, which can generate the redirect loop. In this case, you only need to access your browser settings and clear its cookies and cache.
 
By following the next guide you can see  How to clear the cache of different Internet browsers
 
Disable plugins
A redirect loop may be the result of an active plugin on your site. If you cannot access your CMS administrator panel, you can disable plugins via FTP or SSH:
 
In this guide you can see  How to disable WordPress plugins via FTP, the process is the same in all CMS platforms but using their respective plugins folder.
 
If disabling your website plugins makes the site load properly, it means the loop was caused by one of the installed plugins. It is recommended to leave that plugin disabled and look for an alternative.
 
Database redirects
If there is an error in the URL assigned in the database, it may generate the error when trying to access the other address, causing the previously mentioned loop. You can edit the URL configuration through your hosting database:
 
 
As with other possible errors, the process varies depending on the CMS installed. Below are guides on how to modify the associated domain in WordPress and Prestashop from the database:
 
 
.htaccess file 
You can also check the .htaccess file in your website directory.
 
The .htaccess file controls page redirects, so a small issue in this file may cause a redirect loop error when loading your page if it is not configured correctly.
 
We do not recommend deleting the .htaccess file directly, but rather replacing it with a default .htaccess file to verify whether the original file is the source of the error.
 
 
If you are using WordPress, it is possible that if your wp-config.php is not properly configured, the error may be there. You only need to verify that one or both of the following lines are not present:
 
define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');
 
Temporarily disable the Content Delivery Network (CDN)
Another possible cause of a redirect loop error is a third-party service installed on your hosting. In most cases, this relates to CDN configuration. A CDN is a network of proxy servers located in different places to ensure high website loading speed.
 
The redirect loop issue arises when your CDN has the SSL option set to Flexible, which means it sends unencrypted requests to your website server.
 
If your website is configured to redirect all HTTP requests to HTTPS while using flexible mode, a redirect loop problem will occur.
 
If that is the case, configuring the CDN SSL settings to Full should resolve the issue if you have an active SSL certificate.
 
 
For more information, you can  contact us.
    • Related Articles

    • Frequent Woocommerce errors and how to fix them

      Online sales are currently on the rise, and the demand for having an eCommerce store for any physical business is now a reality. WordPress is an application that allows you to build all kinds of websites, and of course, it also enables you to create ...
    • How to correct Apache's 'Failed to read FastCGI header' error

      The error message "Failed to read FastCGI header" means that when Apache communicates with the PHP process of your hosting, the PHP process does not respond correctly. This error does not mean there is a problem with Apache itself, but that there may ...
    • How to set up custom error pages

      There are many types of server errors that may appear on your website and usually display a default server message. From the Control Panel, you can make this error message a custom page. To access it, go to the hosting management, and in the 'Server' ...
    • Database error: Unknown column "id" in field list

      The error you are seeing in WordPress, "WordPress database error: [Unknown column 'id' in 'field list']", refers to an unknown column in a database table. This is one of the most common causes of errors in WordPress, and it is usually due to one of ...
    • Information and causes: Error_Connection_Reset

      The "connection reset" error is an error message that appears in the browser when you try to access a web page and the connection is unexpectedly interrupted before the page finishes loading. This error message can appear for various reasons, but it ...