Redirects in WordPress are very important to ensure that the users are directed to the right destination. One common use of redirects in WordPress is when rendering SEO approved URL format on your site. Redirect functionality is also used by many plugins including caching plugins, SEO configuration plugins, and SSL plugins.
What causes the ‘too many redirects’ WordPress error
In most cases, websites that show this error are usually as a result of misconfiguration of redirection tools. The user’s browser is stuck in a loop where a request is bounced off between two or more URLs. As a result, the user received an error message resembling the one shown below.
This tutorial will discuss all the available ways of fixing the redirect loop error. There are two options available. Each option has different requirements. The two options ensure that almost all scenarios are covered in this tutorial.
Option 1: Edit Home and Site URL
You need backend access to the WordPress admin dashboard or Cpanel access.
Once logged in, you need to go to the general settings and check for URL misconfiguration. You need to ensure that the Site Address and WordPress Address are correct and identical.
If you are unsure of the correct URL, you can try to include or omit the ‘www’ prefix on both URLs to see if the redirect error is corrected.
Note: Do not leave a slash at the end of the URL!!
Once logged in, click on the file manager.
Open the ‘public_html’ folder.
Locate and select the ‘wp-config.php’ file then click on the edit option at the top.
Click on ‘edit’ on the pop-up that appears.
Finally, add the two lines of code just above the comment shown in the image below
Note: Rememer to replace ‘avoiderrors.com’ with your URL.
Click on the ‘save changes’ button at the top to update changes.
If Option 1 did not work for you, then the problem may be caused by a plugin. For this option, you need either Cpanel access or WordPress backend access.
1. You need to deactivate all the plugins then check if the error disappears.
2. If the error is corrected, you need to reactivate the plugins one by one.
3. After each activation, you should check if the error reoccurs.
This method will effectively show you which plugin is causing the misconfiguration in your WordPress website.