localhostwp-admin on my local redirects to production site's wp-admin

So when I go on localhost, my development environment loads fine. But when I try to go to wp-admin, I get redirected to

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.

Share Improve this question asked Jun 20, 2013 at 21:18 bigpotatobigpotato 3352 gold badges6 silver badges17 bronze badges 3
  • 1 Do you have phpmyadmin? Search for other site URL in entire database. Probably somewhere in options. – GhostToast Commented Jun 20, 2013 at 21:20
  • Yeh I do have it. I found it in options too, one called siteurl and one called home and a few more to specific paths. Which one do I change? – bigpotato Commented Jun 20, 2013 at 21:27
  • @Edmund Both. Changing just these two will suffice for basic operation on localhost, though links within posts & elsewhere will still point to production site. – TheDeadMedic Commented Jun 21, 2013 at 2:21
Add a comment  | 

4 Answers 4

Reset to default 3

You 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

相关推荐

  • localhostwp-admin on my local redirects to production site's wp-admin

    So when I go on localhost, my development environment loads fine. But when I try to go to wp-admin, I get redirected to

    12小时前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信