Have you ever been irritated by various common WordPress errors like Internal Server Error, Error Establishing a Database, White Screen of Death, and so on? Among those issues, the “Too Many Redirects” error is selected in the following guide to brief you on several valid solutions for this error as well as show you the reasons that result in such embarrassing situation.
If you are the one who suffers a lot of the Too Many Redirects error, you just need to refer to the given methods and then deal with the issue without striking a blowing. Since many readers lack understanding of such WordPress error, we would like to make a brief introduction about it at first.
What Is Too Many Redirects Error & Why You Get This Error?
Too Many Redirects error, also called error 310, is a common WordPress error caused by the improper use of URL redirects as its name suggests. Since WordPress enables URL redirection function for all users to create SEO-friendly URL structure, many webmasters tend to make use of this function to redirect the old URL to a new one by means of a redirect plugin.
Note that, one old URL must be redirected to a unique location. If not, the Too Many Redirects error happens to you naturally. That is to say, if you redirect an old post to two locations, your visitors cannot access to the redirected page and what comes to them is like the following screenshot or a 404 not found page.
In some cases, one of the main reasons that results in such issue is the misconfiguration of an active redirection plugin, which has your visitors caught in a dilemma and increases the bounce rate as well. Fortunately, this step-by-step guide makes it easy to solve Too Many Redirects error.
How to Fix Too Many Redirects Error?
Before everything, you are required to log into your WordPress dashboard and go to Settings > General to check if there is something wrong with the WordPress Address or Site Address.
In some cases, there is no difference between adding a www prefix to the URL and not doing so. That is to say, it leaves to your option. However, if your web host has limited your choice and only allows you to select one way to go, then you need to ensure that you set your URL address by the rule. If not, that will become the main cause to the Too Many Redirects error.
If everything goes well and there is no change after resetting the URL address, you need to refer to the following solutions. Perhaps, contacting your WordPress hosting provider to ask for help is also a good option for you.
Here, we are going to show you three methods to fix Too Many Redirects error effectively, which require you to add lines of command to wp-login.php file, wp-config.php file and PHPMyAdmin.
Modify wp-login.php File
Open your wp-login.php file after connecting your website with an FTP client. Since we create and manage our website by means of cPanel, we will complete all processes via this powerful control panel. Log into cPanel and target Files > File Manager. In general, the root access of wp-login.php should be /public_html/wp-login.php. If you install WordPress on a subdomain, then the root access should be /public_html/subdomain/wp-login.php.
Seek the wp-login.php file from a list of items and right click it to “Edit” it in an editor. And then, add the following command to this file and replace the yourwebsite.com to your own website domain. Finally, “Save” the file to confirm all settings.
//FIXME: do comment/remove these hack lines. (once the database is updated) update_option(‘siteurl’, ‘http://yourwebsite.com/the/path’ ); update_option(‘home’, ‘http://yourwebsite.com/the/path’ );
Keep in mind that since you have successfully fixed the Too Many Redirects error, you need to remove the command mentioned above from wp-login.file.
Modify wp-config.php File
The second method to solve Too Many Redirects issue is making a change to your wp-config.php file which is regarded as the core file in WordPress. Open this file in an editor by complying with the way to open the wp-login.php in cPanel. Likewise, the root access of wp-config.php should be /public_html/wp-config.php or /public_html/subdomain/wp-config.php.
And then, add the following lines to this file. You are required to replace yourwebsite.com to your site domain. “Save” the file to bring the command into effect. Note that, once the following lines come into force, you cannot make any change to the address URL via your WordPress dashboard > General > Settings.
Make Use of PHPMyAdmin
Making a change to your database is also regarded as a valid solution for Too Many Redirects error. Perhaps, you can reach the target by using PHPMyAdmin that is a great tool for the administration of MySQL database. Here, we would like to proceed to the following process via cPanel. Log into cPanel and go to Databases > phpMyAdmin.
When you have successfully accessed to the PHPMyAdmin interface, you need to add the given command to SQL tab and then replace the yourwebsite.com to your own site information.
UPDATE wp_options SET option_value = 'http://yourwebsite.com' WHERE option_name IN ('home', 'siteurl');
If You are Using a URL Redirect Plugin
Since all methods mentioned above cannot do anything for you, then you should check if there is something wrong with your plugin especially for the URL redirect plugin that are activated on your website. Here, we would like to take the Redirection plugin as an example, which enables you to create URL redirect in a simple manner.
If you have redirected the URL http://www.yourwebsite.com /1 to another URL http://www.yourwebsite.com/2, and then you redirect the second URL to the first one since you have forgotten about the previous redirect. In this way, the Too Many Redirects error occurs to your website naturally and the page should be like the following screenshot if someone visits one of the URLs.
In this situation, you should delete one of the redirects immediately and check if there are some similar mistakes happening on your website.
If you are using multiple plugins on your website and cannot make certain which plugin goes wrong, you should deactivate all plugins and update them all at once. And then, activate those plugin one by one. Each time you do that, you need to browse your website to check if there is a Too Many Redirects error. We hope that such a strict method can help you troubleshoot the root of the problem as soon as possible.