I’m setting up a “local environment” for making some changes on a wordpress site. I have successfully exported the DB and import it on my local using phpmyadmin.
The problem occurs when I try to access “local.wordpress.test” as it takes me straigt to the original www.site.com.
So far, the only thing I’m sure is that this URL is stored somewhere in the DB, and I’m stuck here..
2
Answers
it happen because your database is still pointing your live site url
just run following query after change following
OLDURL = your live url
NEWURL = your local url
To run your site with live DB in local environment you have to open your DB file in any editor like sublime or notepad or notepad++ then search for your live site url and replace it with your local environment url. you have to replace all urls in your DB with your local url after that import that updated DB in your local phpmyadmin. after successful importing login to your admin panel go to settings-> permalink and hit the save button so it will create a new .htaccess file. hit the local url and your site will work in local.