Running a self hosted WordPress.org site has a lot of benefits, but at times some easily solveable errors can irritate beginners. White screen of death, Internal server error, and some other common WordPress errors can be really stressing for new users. Recently a user pointed our attention to ‘Too Many Redirects’ error in WordPress. It is a common issue that WordPress users may come across. In this article, we will show you how to fix error too many redirects issue in WordPress.
On Firefox, this error will be displayed like this:
“The page isn’t redirecting properly. Firefox has detected that the server is redirecting the request for this address in a way that will never complete.”
Why I am Getting Error Too Many Redirects in WordPress?
This error usually occurs due to a misconfigured redirection issue. As you know that WordPress has SEO friendly URL Structure which uses the redirect function. Several other popular WordPress plugins also use the redirect functionality. For example, WordPress SEO plugin allows you to remove category base from category URLs by redirecting users to a URL without category base. WordPress SSL and cache plugins also use redirects.
Due to a misconfiguration in any of these redirection tools, your site may end up redirecting users to a URL that is actually redirecting them back to the referring URL. In that case the user’s browser is trapped between two pages and hence you see the error.
How to Solve Too Many Redirects Error in WordPress?
The most common misconfiguration that we have come across repeatedly is when a user has incorrect URL in WordPress Address URL or Site Address URL settings.
For example, lets assume that your site’s url is http://www.example.com
and you go to Settings » General and set it to http://example.com
.
Most web hosts allow you to choose whether you would like to add a www
prefix to your domain name or have it without www. In case you had
selected to add www to your URL, then adding http://example.com in your
WordPress settings will cause the error. Or if you opted to use your
domain without www prefix, then adding it with www prefix in WordPress
settings will cause this error.
When a user will come to http://example.com
, they will be redirected by your server’s configuration to http://www.example.com where they will be redirected back to http://example.com
by WordPress because that’s what you have set up in the settings.
If your site was working fine, and you you did not make any changes to those settings. Then you need to contact your web host, because it is most probably a configuration issue at their end.
However, if you do not have a reliable WordPress hosting provider, and they deny having any issues and/or refuse to help you, then you should consider switching web hosts or fix it yourself.
To fix this, you need to change your WordPress Address and Site Address. Go to Settings » General, change your WordPress and Site Address. If you have your address with www prefix, then change it to non-www URL, and if you have it with non-www URL then add the www prefix.
Important: Make sure that you don’t leave a trailing slash at the end of your URL like http://www.example.com/
Change Site URL Without Access to Admin Area?
In case you don’t have access to WordPress Admin area, you can still update these settings by defining them in wp-config.php file. Simply connect to your website using an FTP client. Once you are connected to your site, you will find wp-config.php file in your site’s root directory. You need to download and edit this file using a text editor like Notepad. Simply add these two lines to the file and don’t forget to replace example.com with your own domain.
12 |
|
Comments
Post a Comment