Hi all,

I'm having an issue with a local copy of a live WordPress site. The local site itself "http://localhost/mywordpress/" works, but when I try to access the wp-login.php page, it redirects me to the production site. I do the following under a local XAMPP setup:

copy the production WP folder;
import the MySQL database to the local db with the same credentials as production (I've already created the db and username);
update the 'home' and 'siteurl' to localhost;
delete the wp-config.php file so that I can set up the configuration manually;
upon the setup, I am able to view the site's homepage, but accessing http://localhost/mywordpress/wp-login.php redirects me to the production site.


2 Years
Discussion Span
Last Post by RudyM

So, what is the directory tree for the production site, and your local site? Also, have you made sure that none of the directories are links to elsewhere?


My production site and localhost site have a similar structure. Basically, I copy the production wordpress site to localhost and perform the steps I outlined in my original post:

Production: http://www.mysite.com/mywordpress/....
Development: http://localhost/mywordpress/

How do I check whether the directories themselves are links elsewhere? It seems like this may be an issue since accessing something like 'http://localhost/mywordpress/wp-admin' redirects me to the production site also 'http://www.mysite.com/mywordpress/wp-admin'.



After further tinkering now the wp-login.php page submits and redirects to the production site.

What I did was copy the wp-login.php code to another file wp-login2.php; and then when I noticed the redirect happening, I replaced all wp-login.php with wp-login2.php, and this problem persists.



Ok, so what I did finally was disable all plugins via MySQL:

update wp_options set option_value = '' where option_name = 'active_plugins'. The site is up and I'm able to log in. So in the end, it was a plugin causing the issue. So I disable them all since it's only for a development server. This was my solution, if it helps anyone else out there. Thanks.

Edited by RudyM: Update.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.