wp-admin redirects to wp-login.php after moving site to localhost
-
After a WordPress site I used to manage got replaced by a completely (non-WP) new site, it turned out we needed some stuff from the old site. The previous hosting company provided me with a complete backup of the site, including the database, and now I’m having trouble getting it running on my own computer.
After I successfully imported the MySQL database, got it accessible to WordPress and added
define( 'WP_SITEURL', 'https://localhost/~gurth/WP' );
to wp-config.php to stop links going to the replacement live site, I thought I was home and dry …However, I now have the problem that wp-login.php and wp-admin are stuck in a loop: wp-login.php accepts my username and password, but wp-admin then immediately redirects me to the login page with this URL:
https://localhost/~gurth/WP/wp-login.php?redirect_to=http%3A%2F%2Flocalhost%2F%7Egurth%2FWP%2Fwp-admin%2F&reauth=1
I tried adding
update_option('siteurl', 'https://localhost/~gurth/WP' );<br /> update_option('home', 'https://localhost/~gurth/WP' );
to wp-login.php, as suggested in the Codex article on moving to a new server, but that doesn’t change anything.
Does anyone have any tips?
- The topic ‘wp-admin redirects to wp-login.php after moving site to localhost’ is closed to new replies.