How to Fix “Too Many Redirects” WordPress Error
![How to Fix “Too Many Redirects” WordPress Error](https://flatrocksoft.com/wp-content/uploads/2023/11/How-to-Fix-Too-Many-Redirects-WordPress-Error.jpg)
[ad_1]
URL redirects are necessary when you need to change the addresses of a website page permanently or temporarily.
However, as a result, sometimes your website can get stuck in a redirection loop.
If this happens, you may face the ERR_TOO_MANY_REDIRECTS error, preventing you from accessing specific pages.
The problem usually lies within your website, browser, server, or third-party plugins or programs. Fortunately, redirection issues can typically be fixed by following a troubleshooting workflow. When you know what to do to diagnose the cause of the error, you can solve it relatively quickly.
In this article, we’ll look at common causes of the “too many redirects” error, both on-site and off-site, and how to fix each. Plus, we’ll explain how to prevent the problem from happening again in the future!
What Causes ERR_TOO_MANY_REDIRECTS In WordPress?
The “too many redirects” error happens when your WordPress website gets stuck in an infinite redirect loop.
A redirect loop is when a web server repeatedly sends a browser to the same page over and over, preventing it from loading the intended page.
When this continues, your browser may trigger the error and fail to load the site.
This error looks different depending on the browser you use.
For example, in Google Chrome, it usually says something like “This page isn’t working,” stating too many redirects as the issue and showing the ERR_TOO_MANY_REDIRECTS code.
If you use Mozilla Firefox, the error usually reads as “The page isn’t redirecting properly.” It usually displays as “Safari Can’t Open the Page” for Safari users and will let you know the reason is because of too many redirects.
Unlike some other common WordPress errors, the “too many redirects” issue doesn’t usually solve itself.
So you’ll need to troubleshoot the origins of the problem to fix it. Here’s how.
How To Solve The “Too Many Redirects” Error (13 Methods)
Various factors can cause the “too many redirects” error. Some may be within your WordPress site, but you’ll likely need to go down a few different paths before you track down and eventually solve the issue.
So with that in mind, let’s take a look at a comprehensive list of most of the possible solutions.
1. Force A Page Refresh
The first solution is a very simple one. You can force your browser to refresh and retrieve a new version of the page. This method overrides any stored data and displays the latest information available for the WordPress website.
You might like to try this method first because it’s quick and won’t interfere with any other strategies. You’ll also know straight away if it has fixed the problem or not.
You can use the following keyboard shortcuts to force a refresh in your browser:
- Google Chrome (Windows): Ctrl + F5
- Google Chrome (Mac): Command + Shift + R
- Safari: Command + Option + R
- Firefox (Windows): Ctrl + F5
- Firefox (Mac): Command + Shift + R
That’s all you need to do. If this simple method doesn’t work, you can continue through the troubleshooting guide.
Get Content Delivered Straight to Your Inbox
Subscribe to our blog and receive great content just like this delivered straight to your inbox.
2. Delete Cookies On Your Site
Cookies are small blocks of data that enable websites to remember information about your visit. Then, the sites use that data to speed up and customize your experiences.
For example, an e-commerce platform might send you on-site recommendations based on your previous purchases and searches. This way, you’ll be able to save time when looking for related products.
However, cookies can sometimes hold onto incorrect data. In turn, this can cause the “too many redirects” error. When this occurs, you should try deleting cookies from the WordPress site.
In Google Chrome, click on the three dots across from your address bar and go to Settings.
In the left sidebar, go to Privacy and security (the sidebar may be collapsed, hit the three-line menu to open it). On that page, select the Third-party cookies option.
On the next page, select See all site data and permissions.
This will open a list of all the different sites storing cookies. Search for your website and use the trashcan icon next to it to delete the data it’s storing.
Once you’re done, refresh the WordPress site to see if the error is fixed.
Related: WordPress Settings Overview
3. Clear WordPress Site Or Server Cache
Caching stores information about your site so it can load faster the next time you access it.
The downside is your cache can hold onto outdated data and cause a redirection error. Therefore, you can try clearing out the stored information to see if it fixes the problem.
If you can access your WordPress site, you can try to clear your WordPress cache with a dedicated caching plugin like WP Super Cache.
However, the redirection error will likely prevent you from getting to your dashboard. Therefore, you might need to try clearing your server cache.
If you’re a DreamPress customer and have a shell account, you’ll need to log into your domain with Secure Shell (SSH) protocol.
Then, you can enter the following code to purge your cache:
curl -X PURGE “http://yourwebsite.com/.*” ; wp cache flush
Once you’ve cleared out the cache, try reloading your site. If that doesn’t work, you may need to try another method.
4. Clear Browser Cache
Your browser also stores cached information about the websites you visit, including your own. If your browser is holding onto outdated data, you may need to clear it out to fix the redirection error in WordPress.
If you’re working with the Chrome browser, you can head back to Settings > Privacy and security. Here, click on Clear browsing data.
This will bring up a new window that enables you to choose the data you want to delete including browsing history, browser cookies, etc. Select each item by checking the box next to it and then click on Clear data.
You’ll need to use slightly different methods if you’re working with a different browser.
When you’re done, try reloading your site to see if the “too many redirects” error has gone.
5. Determine The Cause Of The Redirect Loop
If the earlier methods didn’t solve the redirection error, you need to try and diagnose the underlying problem. Otherwise, you might spend a lot of effort on more time-consuming strategies that still may not fix the error.
There are a couple of different methods you can use to determine the cause of redirect loops.
Firstly, you can enter your site’s URL into the Redirect Checker tool.
This free online application lets you enter multiple URLs and check their statuses. You can also specify the user agent, such as your browser, search engine bots, and mobile devices.
Once you enter your URL, you can see any status or error codes associated with your site at the bottom of the page.
Alternatively, some browser add-ons can show you the nature of redirects on different sites. For example, the Redirect Path Chrome extension flags redirect error messages in real time.
Unfortunately, these tools might not always tell you why your redirect error is happening. If this is the case, you can continue with the other strategies in this troubleshooting guide.
6. Temporarily Disable WordPress Plugins
WordPress plugins are helpful tools that can introduce new functionalities to your website. However, these add-ons can also cause issues, such as the “too many redirects” error.
Anyone can develop and share WordPress plugins. As such, you may accidentally download one that contains faulty code. These add-ons also have frequent updates. If you haven’t updated your plugins, they may also be causing problems on your site.
Try this method if you recently added new plugins to your WordPress site. Even if you don’t suspect a particular plugin, you can use the following steps to address the issue.
If you can’t access your WordPress site, you’ll need to access the plugin files via a Secure File Transfer Protocol (SFTP) application like FileZilla.
(You may also be able to access your site files via your host’s file manager.)
Once you’ve connected the SFTP client to your site, you’ll need to find the folder that holds your plugins. You’ll usually find it under domain of your site > wp-content > plugins.
Here, you’ll see a series of folders with the names of your installed plugins.
Rename the plugins folder to “plugins-off”. This will deactivate all of your plugins. You should now be able to access your WordPress admin dashboard.
Next, rename your plugins folder to its original title. Then go through the process of reactivating each add-on from your WordPress dashboard (Plugins > Installed Plugins) to see which one throws the “too many redirects” error.
If you find a problem plugin, keep it deactivated and find an alternative option for your website in the WordPress plugin directory.
7. Check WordPress Site Settings
Sometimes an error in your WordPress site settings can cause redirect loops.
For example, your website might be pointing to the wrong domain name for your site files. This more commonly happens if you’ve recently migrated your website.
You can check your site settings in your WordPress dashboard.If you can access it, log in and head to Settings > General.
You’ll then see two fields for WordPress Address (URL) and Site Address (URL).
These two addresses should be identical unless you want WordPress to have its own directory.
If the URLs don’t match and they should, you can change the settings manually. To do this, you’ll need to edit your site’s wp-config.php file.
Access your website using SFTP as you did previously. Then, locate and open the wp-config.php file in a text editor.
Next, you’re going to paste the following code into the file:
define( ‘WP_HOME’, ‘http://example.com’ );define( ‘WP_SITEURL’, ‘http://example.com’ );
Replace the example URLs above with the correct ones and save the file. Then reload your website and see if this solved the problem.
8. Check SSL Certificate
If you’ve recently migrated your site to HTTPS, there are various steps you need to complete.
Unfortunately, if you miss some of them or misconfigure some settings, you could trigger the “too many redirects” error in WordPress.
For example, if you didn’t install your Secure Sockets Layer (SSL) certificate correctly, it could be causing problems. If you didn’t add it at all, your site would automatically get stuck in a redirect loop.
SSL/TLS
SSL stands for Secure Sockets Layer. In short, it’s a protocol for maintaining a secure connection and protecting sensitive data. Transport Layer Security (TLS) is the successor to SSL. It is a cryptographic protocol that provides a safe connection over any given computer network.
Read More
However, there might also be some minor issues with your SSL certificate installation. For example, you might have incorrectly installed the intermediate certificates that work together with your main one.
You can check if your SSL certificate is correctly installed using a tool such as the Qualys SSL Server Test.
This application scans your domain to find any associated SSL issues. This process can take a few minutes, but it will alert you to any problems with your certificate installation.
9. Update Hard-Coded Links
If you’ve just switched from HTTP to HTTPS, you’ll need to redirect your links. Otherwise, these URLs will point to locations that no longer exist on your website.
Many users utilize plugins that can change these links automatically, such as Better Find and Replace.
But it can be risky to use an add-on. If your chosen plugin has any issues with its code or updates, it can misconfigure your redirects and trigger the “too many redirects” error.
We recommend that you manually update your hard-coded links. You can do this with the search and replace method in WordPress.
We have a complete guide on how to change your WordPress URLs. If you’re a DreamHost customer, you can also reach out to our Technical Support team for assistance.
10. Check For HTTPS Redirects On Your Server
HTTPS redirect rules can also cause the “too many redirects” error in WordPress. These server settings may have been misconfigured when you migrated your site.
For example, your HTTPS settings may not be correctly redirecting your links. As such, you’ll need to amend them.
To determine your method, first you’ll need to know which server type your host uses.
If your site uses an Apache server, you’ll need to edit your .htaccess file.
Locate it within your SFTP client and open the file in a text editor. Then, you can enter the following code:
RewriteEngine OnRewriteCond %{HTTPS} offRewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
This code will cause all HTTP links to redirect to HTTPS automatically. Save the .htaccess file when you’re done.
To adjust your HTTPS redirects on Nginx servers, you’ll need to ask support to help you adjust the config file. Have them insert the following code to set up your redirects:
server { listen 80; server_name domain.com www.domain.com; return 301 https://domain.com$request_uri; }
Once that has been put into place, reload your WordPress site.
If it doesn’t fix the problem, you know the drill — keep moving through the troubleshooting steps in this guide.
11. Check Third-Party Service Settings
If you use a third-party service such as a content delivery network (CDN) or web application firewall (WAF) like Cloudflare, its settings may cause the “too many redirects” error.
CDN
CDN is an abbreviation for “Content Delivery Network”. It refers to a geographically-distributed network of web servers (and their data centers). The entities that make up a CDN collaborate to ensure speedy content delivery via the internet.
Read More
Cloudflare can trigger the “too many redirects” error if you have the Flexible SSL setting enabled and an SSL certificate from another source (such as your hosting provider).
In this scenario, your hosting server requests are already redirecting URLs from HTTP to HTTPS. However, with the Flexible SSL setting, all server requests are being sent in HTTP. This causes redirection loops to happen between the different processes.
That’s why we don’t recommend using the Flexible SSL setting if you have an SSL certificate from a third-party source. Instead, change your Cloudflare encryption mode and choose either Full or Full (strict). Doing so will automatically send requests in HTTPS.
Additionally, you may like to enable the “Always Use HTTPS” rule in Cloudflare. This forces your site to send all requests via HTTPS. Therefore, it avoids causing a redirect loop and triggering the WordPress error.
Finally, double-check that you’ve correctly configured your redirects in Cloudflare. For example, you’ll want to ensure that your domain doesn’t redirect to itself. Otherwise, it can trigger a redirect error.
12. Check Redirects On Your Server
We already covered how to check for HTTPS redirects on your server. However, other redirects can trigger an error when loading your WordPress website.
For example, you might have a 301 redirect misconfigured. It might be pointing to the original link, triggering a redirect loop that prevents your site from loading. You can usually find redirects such as this by checking your config files.
If your site uses an Apache server, you may have issues with your .htaccess file. We recommend creating a new one with default settings.
Apache
’Apache’ is the abbreviation of ‘Apache HTTP Server’. This is a free and open-source web server software that delivers content. Its primary function is to establish a connection between a server and a browser via HTTP requests.
Read More
First, you’ll need to access your site via SFTP. Find the .htaccess file and save a copy of it, in case any mistakes are made. You can do this by renaming it to something like “.htaccess_old”.
Next, you’ll need to make a new .htaccess file. Put the following code into it to establish default settings:
# BEGIN WordPressRewriteEngine OnRewriteRule .* – [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]RewriteBase /RewriteRule ^index.php$ – [L]RewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule . /index.php [L]# END WordPress
Save the file and try reloading your WordPress site. If this process works, you can delete the old .htaccess file and keep working with the new one.
If your site uses an Nginx server, you’ll need to follow a slightly different process. This server type uses a variety of different config files, depending on the hosting provider. We recommend reaching out to your host to see which one applies to your situation.
13. Contact Your Web Hosting Provider
If you’ve tried all of these methods and you can’t fix the “too many redirects” error, it might be time to get some help. You might be missing a crucial step, or there could be a deeper issue with your WordPress site.
By contacting your web hosting provider, you can get fast assistance with the error. For example, DreamHost customers can contact our Technical Support team.
Related: The Ultimate Guide To Web Hosting
How To Prevent ERR_TOO_MANY_REDIRECTS In The Future (3 Ways)
If you want to prevent the “too many redirects” error, there are a few steps you can take within your browser and site. Let’s take a look at them.
1. Keep Plugins Up To Date
Outdated or faulty plugins are some of the leading causes of the “too many redirects” error.
We already covered how you can deactivate any add-ons that may be triggering the issue, but you can also take preventative steps right now by keeping your current plugins up to date. This is important because updates frequently address security issues, increase compatibility, and fix bugs.
You can tell if a plugin has a new release because you’ll see an alert in your WordPress dashboard.
You can also navigate to Plugins > Installed Plugins.
Out-of-date plugins should have a message telling you there is a new version available. You can choose to update them one time or enable automatic updates.
Additionally, you can report any faulty plugins if they cause the “too many redirects” error. Find the corresponding support forum using the search bar and document your issue to see if there is a known solution. Moreover, this action could prompt the plugin developers to fix the problem.
2. Clear Your Cache And Stored Cookies Regularly
Earlier in the guide, we explained how to clear cache and cookies. These methods prevent your browser or WordPress site from trying to access outdated data.
It’s likely that you won’t need to use these methods, as most browsers are smart enough to remove outdated cookies and cache items. However, you can streamline the process by using a WordPress plugin to clear your site’s cache.
An add-on such as WP Super Cache allows you to remove cached files manually or select a custom time and interval to scan your site for outdated cache files. You can even elect to receive emails when this process happens.
3. Use A Checklist Or Company For Website Migrations
Many of the causes for redirect errors in WordPress arise from migrations from HTTP to HTTPS.
If you’re not familiar with migrating a site, you may miss some of the essential processes needed to make your website redirect and function correctly.
Therefore, we recommend using a dedicated migration service to take care of the process because professionals have experience with every aspect of migrating a site.
If you prefer to do the migration yourself, here’s a checklist to use during the process:
If you’re migrating to a different server, the process might be slightly different. It pays to do your research before the migration to avoid any errors.
Have Another WordPress Error To Fix?
If you need to resolve other technical problems on your site, we’ve put together tons of comprehensive tutorials to help you troubleshoot every common WordPress error:
And if you’re looking for more information and best practices for running a WordPress site, check out all of our WordPress Tutorials. This is a collection of expert-written guides designed to help you navigate your WordPress control panel like a pro.
Solve Your WordPress Issues With A Trustworthy Hosting Company
The “too many redirects” error can happen in WordPress when the site gets stuck in a redirection loop. Although the problem can be frustrating, you should be able to solve it pretty quickly.
You can usually fix the error by clearing out your cache or cookies. Additionally, there may be solvable issues with your server, third-party platforms, or plugins. Finally, if you still can’t troubleshoot the redirection error, your hosting provider may be able to help you out.
Are you looking for a WordPress hosting provider with caring, dedicated professionals who can help you with redirection issues and other common errors?
Check out our DreamHost’s WordPress packages today! We provide personalized technical support to assist you with any WordPress problems.
Get Content Delivered Straight to Your Inbox
Subscribe to our blog and receive great content just like this delivered straight to your inbox.
[ad_2]
Source link