When trying to login one of my WP installs (regular WP 3.4.2-no multisite), I keep being redirected to the wp-login.php
file.
I’ve checked nearly everything:
-
Password is correct and changed…nothing
-
Reset to a default theme…nothing
-
Deactivated al plugins…nothing
-
Reuploaded my wp-login.php
file…nothing
-
Checked the .htaccess
files…nothing
-
wp-config.php
still looks the same.
-
Erased my browser data and used an other browser… Still nothing.
-
Completely overwritten every WordPress file with a fresh download install.
What else could this be? I didn’t make any upgrades to the code.
Let’s try this,
Open up your wp-login.php
file and add the following update_option
calls,
update_option('siteurl', 'http://your.domain.name/the/path' );
update_option('home', 'http://your.domain.name/the/path' );
beneath,
require( dirname(__FILE__) . '/wp-load.php' );
so… it should look like,
require( dirname(__FILE__) . '/wp-load.php' );
update_option('siteurl', 'http://www.example.com/' );
update_option('home', 'http://www.example.com/' );
Where http://www.example.com/
should match your domain.
- Then visit your login page.
- Then remove the lines added to
wp-login.php
You might need to refresh your login page a couple of times or try and login a couple of times but it should let you in. Might be neccessary to clear your cache.
If all of a sudden,
http://www.example.com/
was appearing like,
http://example.com/ (no www - for example sake)
…then it might be causing this redirect loop issue you are having. Its easy to miss a slight change like that in your login URL as we often are not paying that close of attention.
So by running the update_option
above we reset those paths to their original format.
IF its not the above then make sure you definitely PURGE all of your browser cookies because there is a mismatch somewhere that’s causing the issue. Has to be.