We use WordPress extensively – we self host the wordpress files on our own servers or with a 3rd party hosting company like Godaddy or 1&1 Internet.
For the most part WordPress works great but if you look under the hood there about a trillion files, not to mention a bunch of 3rd party plugins – the end result is that eventually something goes wrong and its hard to trouble shoot when it does. Often the end result is a complete reinstall of all files and database. Not fun. We’d rather be blogging.
The WordPress Admin Site Login Redirect Loop Error
We recently setup a new web site with a new WordPress Blog – lets call it example.com.
For some reason when we went to Login to the admin site (with the correct username and password) the login.php script would redirect back to wp-admin directory. Resulting in an endless loop and preventing us from logging in to the WordPress admin site.
The WordPress Redirect URL
Just to give you an idea, the URL after the redirect was http://www.example.com/blog/wp-login.php?redirect_to=http://www.example.com/blog/wp-admin
To cut a long story short and after trying many many different strategies to resolve this issue (and many hours) we finally came up with the solution:
Simply paste @define(‘ADMIN_COOKIE_PATH’, ‘/’); to the very top of your WordPress wp-config.php file. (This file is in the root of your WordPress directory).
We finally found the answer by Googling various keywords but it took a while to come up with the right keywords that lead us to another user who had this same problem.
Cookies no doubt were the issue here but we got this error on all browsers and across multiple networks so it was in no way isolated to a single computer.
Clearing all cookies from the browsers also did not help, neither did deleting all plugins as some people suggested.
How to login to your WordPress admin site when all else fails to solve the redirect loop
One of the frustrating things about this problem was that we could not log back in to the admin site to try to resolve this problem by tweaking settings from within WordPress admin site.
Eventually we found a hack that got us in.
After entering the username and password and hitting submit the WordPress admin site loads in the following sequence if you watch the URL:
(The last url bringing you back to where you started – not what you want)
As soon as http://www.example.com/blog/wp-admin appears hit the stop button on your browser so that the page stops loading.
Then click in the URL bar of your browser (which should still contain the URL http://www.example.com/blog/wp-admin) and hit enter to reload the page.
This then took us direct to the admin site no problem
Good luckPosted on: Saturday, June 19th, 2010 - 2 years, 11 months ago