Member Avatar for RudyM

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.

Thanks.

Member Avatar for RudyM

UPDATE:

When clicking on other links on the homepage, I get redirected to the XAMPP dashboard page. This despite the link addressing to http://localhost/mywordpress/somelink/.

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?

Member Avatar for RudyM

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'.

Member Avatar for RudyM

UPDATE:

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.

Member Avatar for RudyM

UPDATE:

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.