Infinite Redirect Loop during WordPress Login


The Other Loop

WordPress has a very intuitive and straight forward admin interface. This is one of the reasons I choose to deploy client projects on WordPress. It’s abilities have made it one of the leading software packages for content aggregation. Although it’s almost perfect, there are still some things that users and administrators may over look which could lead you to experience a bug. A infinite redirect loop when logging in could be one of them. Luckily for them, I get to work out all the bugs before the keys are handed over.

The Fix

This fix is pretty easy. What happens depending on your configured settings and what URL (including subdomain) you access the login page from, you confuse WordPress. WordPress knows it needs to authenticate the user, but if this is happening after the login form already posted, you get stuck in an infinit loop.

For Apache’s .htaccess

Add the following just below the RewriteBase directive in your sites .htaccess:

6 thoughts on “Infinite Redirect Loop during WordPress Login

  1. Jens

    I’m impressed, I have to admit. Seldom do I come across a blog that’s equally educative and interesting, and let me tell you, you have hit the nail on the head. The problem is an issue that not enough people are speaking intelligently about. I am very happy that I stumbled across this during my hunt for something regarding this.

  2. Aida

    This design is spectacular! You most certainly know how to keep a reader entertained. Between your wit and your videos, I was almost moved to start my own blog (well, almost…HaHa!) Wonderful job. I really loved what you had to say, and more than that, how you presented it. Too cool!

  3. Sean L

    This looks like it’s for wordpress on apache. Anyway to convert this to a rewrite rule under “location” for nginx? I get the redirect loop once hitting login but if i put the index.php after wp-admin the redirect loop goes away

Leave a Reply