If you have a WordPress website, it is possible that you will encounter the message 'Error too many redirects'.
This error occurs because of a problem with the redirection or forwarding of (a part of) your WordPress website. This can be caused by plugins that use redirect techniques or by an error in the configuration of your WordPress website.
In this article we explain how you can solve this error message for a WordPress website on a TransIP webhosting package.
Check your installed plugins
In our experience, the message 'Error too many redirects' is most often caused by a plugin that uses redirect techniques. To find out which plugin is causing these problems, you can use the article 'Activating and deactivating WordPress plugins'.
The article explains how to deavtivate your plugins and then reactivate them one by one. This way you can quickly find the culprit.
I get the 'Error too many redirects' error when visiting the test URL
If you only see this error message when accessing your test URL, the wp-config.php file of your WordPress website may to be configured correctly.
If you have installed WordPress on your web hosting package via your control panel, we will automatically set up the wp-config.php for you. If you installed WordPress manually or made adjustments to the wp-config.php file yourself, this may be the cause of the redirects.
To resolve this, go to the 'SFTP File Manager' and locate the wp-config.php file within the /www foler. Open the file within the File Manager or download it and open it in a text editor such as Notepad++ or PHPStorm.
if (isset($_SERVER['HTTP_X_TRANSIP_TRANSURL'])) {
if (isset($_SERVER['HTTP_X_TRANSIP_TRANSURL'])) { define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST'] . '.transurl.nl'); define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST'] . '.transurl.nl'); } else { define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST']); define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST']); }
if (isset($_SERVER['HTTP_X_TRANSIP_TRANSURL'])) { $_SERVER['HTTP_HOST'] = $_SERVER['HTTP_HOST'] . '.transurl.nl'; } define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST']); define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST']);
It is possible that this error message only appears on the test URL. If you do not want to make any changes to the wp-config.php file, you can also choose to point the DNS of your domain to your web hosting package.
Your website will then no longer use the test URL, but your own main domain. This could resolve the error message immediately.
If you still see the error message after following the steps above, the problem may be more difficult to solve.
In this case you can choose to restore a backup from a moment when the WordPress website was still accessible. You can find how to restore a backup of your webhosting package in this article.
In this article we explained how to resolve the 'Error too many redirects' message for your WordPress website.