“Too many redirects” error: What it is and how to fix it
Running into a “Too Many Redirects” error can be frustrating, especially when it blocks users from accessing a website. This error happens when a website gets stuck in a redirection loop, preventing pages from loading. For website owners, this error results in lost traffic and diminished credibility.
In this article, we’ll explain the “too many redirects” error, dive into its causes, and offer practical solutions to fix it.
What does the “too many redirects” error mean?
The “too many redirects” error, or a redirect loop, occurs when a browser continuously redirects from one URL to another without reaching its intended destination.
Think of it like asking for directions and being sent back to the same people repeatedly. Eventually, the browser gives up and displays the “too many redirects” error message, which may look different depending on the browser you’re using. Here’s what you might see:
- Google Chrome shows ERR_TOO_MANY_REDIRECTS or This webpage has a redirect loop.
- Mozilla Firefox displays The page isn’t redirecting properly.
- Safari shows Safari Can’t Open the Page.
- Microsoft Edge shows This page isn’t working right now.
Common causes of a redirect loop
Several factors lead to the “too many redirects” error. Below are the most common causes.
Misconfigured .htaccess file
The .htaccess file helps control website redirects. Incorrect or overlapping rules in this file can create a continuous loop, causing the browser to endlessly redirect between pages.
Conflicting SSL settings
This happens when a website attempts to enforce a secure connection. Improper SSL certificate configuration can disrupt how browsers process redirects.
CMS or plugin errors
Websites using content management systems (CMS) like WordPress, Joomla, or Drupal are vulnerable to this issue due to several factors. For instance, CMS plugins can create incorrect redirects, and updates can introduce bugs or misconfigurations that lead to redirect loops.
Third-party issues
Errors can also come from third-party services or a content delivery network like Cloudflare. The “too many redirects” error occurs because of incorrect settings. For instance, if the encryption mode is off or doesn’t match the installed SSL certificate.
Browser caching
Browsers store data from previously visited websites to speed up loading time. But sometimes, the browser saves outdated redirect instructions, which causes a redirect loop.
How to fix the “too many redirects” error
Here are a few simple, actionable tips to resolve “too many redirects” error.
Clear browser cache
Old cached browser data might be causing redirect loops to persist. Clearing cached data could fix this. Here’s how to do it in Google Chrome.
1. On the right-hand side of the screen, click the three dots.
2. Scroll down through the different and click settings.
3. On the left-hand side of the screen, click Privacy and Security.
4. Click Delete browsing data.
5. Uncheck Browsing history if you want to keep track of the websites you’ve visited. This will prevent your browsing history from being deleted.
6. Click Delete data to complete the process.
Clear cookies
Another way to fix the redirect loop is by clearing cookies. While the process varies between browsers, it shouldn’t be completely different from each other. Here’s how to do it on Google Chrome.
1. On the top right-hand side, click the customization button or the three dots.
2. Go to settings.
3. Click Privacy and security.
4. Click the Third-party cookies option.
5. Scroll down and click See all site data and permissions.
6. Find the website you wish to clear cookies using the search bar.
7. Beside the website, click on the trash bin icon.
Redirect rules in .htaccess
If clearing cookies and browser cache isn’t helping, the problem could be within your server. To address this, access your hypertext access file or .htaccess file. Use a file manager like cPanel to rename the file and create a new one. Here’s how:
- Through the cPanel, go to File Manager.
- Go to your root directory folder. It’s usually under the name public_html, www, htdocs, or httpdocs.
- Navigate the folder and find your .htaccess file.
- Download it or rename it into .htaccess_old. This will be your backup file if updating the .htaccess file doesn’t work.
- Next, create a new text file and name it .htaccess.
- Copy and paste the following code into the file:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule> - Lastly, save and exit File Manager.
Reload your website. If the error persists, something else could be causing it. Now, go back and restore the old .htaccess file.
Disable plugins systematically to identify conflicts
For a WordPress website, outdated and corrupted WordPress plugins might cause a “too many redirects” error.
To determine which of your WordPress plugins is causing the issue, disable all of them at once and then reactivate them individually. Here’s how:
- Log into your WordPress admin dashboard.
- Select all your plugins.
- Click Deactivate from the Bulk Actions drop-down menu.
- Click Apply.
- Refresh your website to see if the “too many redirects error” is gone. If it is, a plugin is causing the error.
- Activate your plugins one by one and refresh the website after each to find the problematic one.
Ensure proper configuration of HTTP to HTTPS redirects
SSL certificates let you use hypertext transfer protocol secure (HTTPS) to encrypt data transmission. However, if you install your SSL certificate incorrectly or force HTTPS into your website without installing SSL, it will trigger a redirection.
Use an online SSL checker tool to test if your SSL is properly installed, valid, and trusted.
Adjust settings on proxy services
If you have an SSL certificate installed and use Cloudflare, and the settings don’t match, a “too many redirects” error will occur.
To resolve this:
- Log in to your account and check your SSL settings.
- Set it to Full or Full (Strict).
If Flexible SSL is enabled in your SSL setting, Cloudflare serves HTTPS to visitors while communicating with your server over HTTP. This mismatch confuses the origin server, leading to redirect loops.
Access the site in incognito mode
A tip for end users: when you receive a redirect error message, visit the website in incognito mode. This allows you to bypass cached data that might be causing the issue.
Contact your web hosting provider
If all else fails and the problem persists, contact your web hosting provider for assistance. Informing them about the issue allows them to track down its cause and possibly fix it for you.
How to prevent the error in the future
Taking preventive steps can help you avoid the “too many redirects” error. Here are a few tips to help prevent this issue:
1. Setting up redirects properly
Redirects guide visitors from an old page to a new one or enforce secure connections. Remember to configure these redirections carefully to avoid creating a redirect loop. To do this, review all your redirects before applying them and test your site after making changes.
2. Regularly check your site’s health and configurations
Websites constantly change through updates, new plugins, or design tweaks. These changes sometimes introduce issues, including redirect loops.
Try using a website monitoring software to help you scan for problems like redirect loops, broken links, and SSL errors. This enables you to catch potential problems early on.
3. Backup your website when making changes
Finally, always create a backup of your website, especially when making major changes. Backups are your safety net, allowing you to quickly restore your site to its previous state if something goes wrong.
Many web hosts offer backup options, and WordPress users can use plugins for extra protection. A service like Domain.com’s Website Backup provides automatic daily backups and secure cloud storage, so your website stays protected and can be easily restored if needed.
Learn more about troubleshooting errors with Domain.com
The “too many redirects” error can be a frustrating roadblock, but it is fixable with the right approach. In this article, we’ve covered actionable steps to fix this issue and ways to prevent future errors. By staying vigilant, you can keep your website running smoothly and give your visitors a hassle-free experience.
With the right knowledge and tools, managing your site and tackling challenges is a breeze. Visit Domain.com now for more helpful tips and tools to improve your website.