Fix Too Many Redirects Loop Error in WordPress

Last updated on April 29th, 2019 by Robert Abela. Filed under WordPress Admin Tips

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.


erik 02/03/2013

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

Robert Abela 06/03/2013

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.

Nick 19/03/2013

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.

Robert Abela 20/03/2013

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.

Mehrshad 30/04/2013


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

Thank you for help.

Robert Abela 02/05/2013

I am glad it worked for you 🙂

Fred 18/08/2013

This didn’t work for me. My website has stopped loading and is returning this error. I can’t get into my admin panel due to the same error.

Robert Abela 19/08/2013

Hi Fred,

I am sorry to hear you are having problems. Unfortunately offhand it is impossible to determine what is the issue. Send us an email on and we will help you sort it out.

Looking forward to hearing from you.

mehdi 26/10/2013

Thanks man. you survive me. my site works now

johnny_n 14/07/2014

If this doesn’t work (didn’t in my case) check your Admin folder permissions as well – on a dev server they were 775, needed to be 755 on the production server (which is a good thing). Changing the admin folder and enclosed folder permissions fixed the error.

Robert Abela 16/07/2014

Thanks for the tip Johnny.

Guido 03/01/2017

THANK YOU JOHNNY! Setting permissions of wp-admin to 755 did the job for me… I can now access the website again 🙂

Ami 01/03/2015

Hi! Unfortunately, this didn’t work for me. In my case, I use a maintenance mode plugin while am building the website and everything is ok when I am logged in as the the user roles I set to be able to see the site while it has the maintenance screen activated.

But when I get down the maintenance screen and try to access mysite as a normal visitor I get redirected on the “my account” page(I also use woocommerce) and I get this error.

I am really confused..

Robert Abela 09/03/2015

Hi Ami,

Thank you for following our blog. Considering you are using a maintenance screen plugin I can’t really tell off hand what the issue might be. If you need us to look into it get in touch with us on

Maspuc 11/09/2015

This work for me. Thanks a lot

Bizzaviet 25/02/2016

I have err too many redirects after change to https, anybody can help me?
This is my site

Robert Abela 22/03/2016

Hello Bizzaviet,

Please send us an email on and we can have a look at your website.

Mohammadreza 18/03/2016

This worked for me too…
thanks a lot

RMY 08/03/2017

Hi, it didn’t work for me. And my wp-admin had the 755 permission already.
I’ve tryied everything. The new hosting says that might be the template. It might have something to do with the SSL….
Could you help me? I’m desperate now….

Robert Abela 15/03/2017

Hello RMY, we are more than happy to help you. Please drop us an email on so we can start troubleshooting the issue.

remco 07/08/2021

Still having the same issue, but I’m using nginx, so can’t use the htaccess method. Deleting the plugin directory and clearing all cookies and checking permissions doesn’t solve it. So I’m locked out of the admin section. Any help?

Radostin Angelov 13/08/2021

Hi Remco,

Thanks for reaching out!

In this case, it’s hard to tell offhand what is causing the problem, since there could be many factors that are related to this. If you cannot solve it with the above recommendation, my suggestion is to contact your web host.

Best wishes,

Leave a Reply

Your email address will not be published.

Our other plugins