The 'Too Many Redirects' error, often displayed as ERR_TOO_MANY_REDIRECTS in browsers, can be frustrating for website owners and users. This article aims to comprehensively understand what this error means, its potential causes, and step-by-step solutions to fix it.
The ‘Err Too Many Redirects’ error occurs when a browser is caught in an infinite redirection loop. This happens when a website is configured to keep redirecting requests from one URL to another without ever reaching the final destination. As a result, the browser eventually gives up and displays the error message, indicating that it cannot resolve the intended URL.
The Example of Redirect Loop Flow
2. Causes of the 'Too Many Redirects' Error
Several factors can lead to this error, including:
1. Misconfigured Redirects
One of the most common causes is a misconfiguration in the website's redirect settings. For example, if a page is set to redirect to itself or if there are conflicting redirects in the server configuration files (.htaccess, nginx.conf, etc.), it can create an endless loop.
2. Conflicting CMS Settings
Content Management Systems (CMS) like WordPress can sometimes cause this error due to conflicting settings in plugins or themes. For instance, a plugin might redirect URLs in a way that conflicts with the CMS's built-in redirect rules.
3. Cookies Issues
Sometimes, cookies stored in the browser can cause redirect loops, especially if they are outdated or corrupted. This is common in websites that use cookies to manage user sessions.
4. HTTPS and HTTP Conflicts
Redirect loops can also occur when there are conflicts between HTTP and HTTPS settings. For example, if the server is set to redirect HTTP to HTTPS, but a plugin or script redirects HTTPS back to HTTP, it can cause an endless loop.
Safari’s redirect loop alert message example
3. How Do I Fix Too Many HTTP Redirects?
1. Clear Browser Cookies and Cache
Start by clearing your browser cookies and cache. This can resolve any issues caused by outdated or corrupted cookies.
Steps to clear cookies and cache:
1. Open your browser settings. 2. Find the 'Privacy and Security' section. 3. Select 'Clear browsing data.' 4. Choose 'Cookies and other site data' and 'Cached images and files.' 5. Click 'Clear data.'
2. Clear Your Site Cache
Like your browser, the cache stored on your site can trigger the "too many redirects" issue. If the cached data is outdated or corrupted, it can lead to redirect loops. Clear your site's cache through your caching plugin or web hosting control panel to resolve this. This ensures that cached redirect instructions are removed and updated with the correct configurations.
3. Clear Your Server Cache
Server-side caching can also trigger the "ERR_TOO_MANY_REDIRECTS" error. The process for clearing this cache varies based on your hosting provider. Many managed WordPress hosts, such as WP Engine, Kinsta, and SiteGround, offer tools in their dashboards for easy cache clearing.
For instance, if you're using Kinsta, navigate to the "WordPress Sites" page in your dashboard, click on "Actions," and select "Clear cache" from the drop-down menu.
4. Clear Your CDN Cache
Content delivery networks (CDNs) like Cloudflare, Fastly, and Akamai use geographically distributed servers to deliver content more efficiently.
However, if a CDN caches an outdated or infinite redirect loop, it can cause the "too many redirects" error by continually sending the user's browser in circles.
To fix this issue, you must clear your CDN's cache.
If you’re using Cloudflare, go to your domain’s dashboard, select “Caching” from the left-hand menu, and choose “Configuration” to clear the cache.
5. Check Redirect Configurations
Review your website's redirect settings to ensure no conflicting or circular redirects. This involves checking server configuration files and CMS settings.
For Apache servers (.htaccess):
1. Access your website’s .htaccess file via FTP or your hosting control panel. 2. Look for any redirect rules that might be causing a loop. 3. Correct or remove any conflicting rules.
For Nginx servers (nginx.conf):
1. Access your nginx.conf file. 2. Locate the redirect rules. 3. Adjust any rules causing the loop.
6. Disable Conflicting Plugins
If you use a CMS like WordPress, temporarily turn off all plugins and see if the issue persists. If the error is resolved, re-enable the plugins one by one to identify the culprit.
Steps to disable plugins in WordPress:
1. Log in to your WordPress dashboard. 2. Navigate to 'Plugins.' 3. Deactivate all plugins. 4. Reactivate each plugin individually and check the site after each activation.
7. Check HTTPS Settings
If you’ve cleared your cookies and cache but still encounter the "too many redirects" error, the problem might be with your HTTPS settings. HTTPS uses the SSL protocol to secure data transfers between browsers and servers. This error can occur if you force SSL without installing an SSL certificate, causing an endless redirect loop from HTTP to HTTPS.
Ensure your SSL certificate is properly installed and regularly renewed. Tools like SSL Shopper, SSL Server Test, or Digicert can quickly verify your SSL configuration's installation, validity, and trust status.
Steps to check HTTPS settings:
1. Access your server configuration file (.htaccess, nginx.conf, etc.). 2. Look for HTTPS redirect rules. 3. Ensure that HTTPS redirects to HTTP do not conflict with HTTP to HTTPS redirects.
8. Reset Your .htaccess File
If the previous steps have not resolved the " err too many redirects" error, the issue might be related to the redirect setup on your server. To check this, you need to access your .htaccess file, rename it, and create a new one. You can use a file manager like cPanel or an FTP client. Below are the steps for cPanel.
Note that modifying your .htaccess file can cause significant issues if not done correctly, so proceed only if you are confident in your ability or have a developer to assist you.
1. Open File Manager and locate your .htaccess file. 2. Right-click the file and rename it to .htaccess_old to create a backup. 3. Navigate to the public_html directory. 4. Create a new text file and name it .htaccess. 5. Copy and paste the following code into the new file: apache
This will reset the .htaccess file to its default settings. Refresh your site to see if the issue is resolved. If the "too many redirects" error persists, you can restore the backup .htaccess file by renaming it back to .htaccess.
9. Contact Your Hosting Provider
If you have tried all the above steps and still encounter the error, contact your hosting provider for assistance. They can help diagnose server-side issues that may be causing the redirect loop.
Example of Ahrefs report on redirects chains
The 'Too Many Redirects' error can be perplexing, but understanding its causes and knowing how to address them can help resolve the issue efficiently. Following the steps outlined above, you can identify and fix the misconfigurations that lead to redirect loops, ensuring a smooth browsing experience for your users.
Resolve and prevent redirect errors with regular site audits. For this, use Atomseo Broken Links Checker to quickly and effectively identify all errors and misconfigured redirects on your site. Additionally, using this tool, you can check up to 1500 daily links for free.