Michael
Michael

Reputation: 51

WP localhost path loads, then resolves to remote

I have a remote instance of a previously developed WP site running on my Linode at (e.g.) "site.mydomain.com".

I have a local version running in MAMP Pro. when I drill down into htdocs to my working directory, and hit localhost:8888/site/wp-admin/, the url unexpectedly resolves to http://site.mydomain.com.

As I say, this is a site already developed and deployed which we have back in order to do some @font-face css updating.

Since it's built on a custom theme I had nothing to do with, I'm unaware of what hackiness may have been done that might cause this redirect.

Given the behavior, can anyone suggest where I might look for the directive that would tell WP to load the remote site despite the site being invoked from localhost? I don't believe it's an etc/hosts issue, but I could be wrong. I'm still a bit wet behind the ears.

Upvotes: 0

Views: 146

Answers (3)

Moeed Farooqui
Moeed Farooqui

Reputation: 3622

Whenever you move your site from your localserver to live server.Remeber to change the URLs in database.otherwise it will keep pointing to your localurl.

Run these queries:

 SELECT * from wp_options where option_name = 'siteurl' 
 SELECT * from wp_options where option_name = 'home' 

change the URL in option_value to Live server URL.and here you go

Upvotes: 0

Jerry
Jerry

Reputation: 3608

From the wordpress codex:

When your domain name or URLs change - i.e. from http://example.com/blog to http://example.com, or http://example.com to http://example.net - there are additional concerns. The files and database can be moved, however references to the old domain name or location will remain in the database, and that can cause issues with links or theme display.

Wordpress has a bad habit of putting full URL's in the database. I think it's been improved since the last time I had to move a site, but reading the referenced page above will probably answer your question.

Upvotes: 1

hanleyhansen
hanleyhansen

Reputation: 6462

Look at your wp_options table and adjust the values accordingly.

Upvotes: 1

Related Questions