How to fix Too many redirects error in WordPress

When you add additional http authentication to the WordPress admin dashboard or the wp-admin directory, there are chances that you get any of the following errorr when trying to access the WordPress wp-admin directory; The page isn’t redirecting properly, This web page has a redirect loop, Error 310 (net::ERR_TOO_MANY_REDIRECTS) or an HTTP 404 error as seen in the below screenshot.

Too many redirects error in web browser

This is not a WordPress problem or error, but is an issue related to the configuration of your web server or hosting provider. If you do encounter such error, you can solve the issue by adding 1 line to the WordPress root .htaccess file. Follow the below step by step procedure to solve such issue:

  1. Connect to your WordPress website using FTP.
  2. Download the .htaccess file from the root of your WordPress website.
  3. Add the below line before the WordPress rules (above the # BEGIN WordPress line)
ErrorDocument 401 default

That does the trick. Now your WordPress administrator dashboard is protected with double authentication.

WordPress Professional Support: If you need WordPress professional support or WordPress security consultancy, get in touch with us via our contact form or simply drop us an email on help@wpprohelp.com.

Comments

  1. i am running into this issue, and i would just like an explanation of what adding that line does and how it fixes the issue. i tried this on an identical server set up and did not have to do anything to make the double layer auth work

    • Hi Erik,

      Not all services require such line to be added. Usually one has to add such line because the web server is not configured properly and typically this occurs in shared hosting services. By not configured properly we mean that the web server was not configured to serve such scenarios rather than misconfiguration.

  2. Thanks for your solution. With my own situation, I tried a different method that managed to solve the problem.

    Go to Plugins and Select all. Tick Each Checkbox and Select deactivate.

    After this, test your Website – It may or may not work.

    After this “Reactivate” all of the plugins and it might just work.

    • Hi Nick,

      Thank you for your feedback. It is quite strange it worked out for you this way since such issues are not related to plugins but to the web server configuration.

  3. Hi

    I had this problem after protecting my wp admin directory with a password. However, adding these codes solved it.

    Thank you for help.

Speak Your Mind

*

 
facebook twitter rss