Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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.com/wp-admin. Where is this being set? I don't want to be redirected.

share|improve this question
1  
Do you have phpmyadmin? Search for other site URL in entire database. Probably somewhere in options. –  GhostToast Jun 20 '13 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? –  Edmund Jun 20 '13 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 Jun 21 '13 at 2:21
add comment

3 Answers

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

share|improve this answer
add comment

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!

share|improve this answer
1  
Velvet Blues Update URL's is also a great tool to accomplish this. I always use this when moving sites. –  Pieter Goosen Apr 9 at 6:37
add comment

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.org/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.com/find-replace/

Note:

You'll just want to search for the top-level domain like so: http://example.com and replace with http://new.example.com - not a good idea to involve any trailing slash.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.