So when I go on localhost, my development environment loads fine. But when I try to go to /wp-admin
, I get redirected to the production URL mysite/wp-admin
. Where is this being set? I don't want to be redirected.
So when I go on localhost, my development environment loads fine. But when I try to go to /wp-admin
, I get redirected to the production URL mysite/wp-admin
. Where is this being set? I don't want to be redirected.
4 Answers
Reset to default 3You can find and replace instances of the old URL in your database but it's best to use a tool that handles serialized data such as BackupBuddy to avoid breaking things like some plugins. Hope this helps!
Use find and replace to find instances of your old URL and update to your new URL.
Here is a decent article on it.
http://codex.wordpress/Moving_WordPress
I wrote a little script that will create the necessary SQL code to put in phpmyadmin's SQL box (please backup DB first though)
http://tools.morningstarmediagroup/find-replace/
Note:
You'll just want to search for the top-level domain like so: http://example
and replace with http://new.example
- not a good idea to involve any trailing slash.
You can accomplish this by using WP CLI. Just run
wp search-replace old-domain new domain
Too bad WP doesnt provide in-built configs for production and local envs like PHP frameworks.
You'll have to change siteurl
and home
in wp_options
to the production site URL
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745316184a4622230.html
siteurl
and one calledhome
and a few more to specific paths. Which one do I change? – bigpotato Commented Jun 20, 2013 at 21:27