Friday, January 31, 2014

How to change the URL of moved Wordpress site

If you have just developed a Wordpress site and uploaded it to a remote server, you may end up with a problem of redirecting your site to your localhot though you try to access your site by typing the remote site's URL.
The reason for this problem is URLs of your posts and other pages are still not changed from 'localhost' to your remote server's address. You can do the conversion as follows.

Go to your database and browse 'wp_option' table. Then change the values of 'siteurl' and 'home' in 'option_name' field to your current remote server's address.

Finally go to 'wp_posts' table and go to SQL command tab in your PHPMyAdmin. Type the following query
UPDATE wp_posts
SET guid =
REPLACE(
guid,
"olddomain.com/wordpress",
"www.newdomain.com"
);

Change the  "olddomain.com/wordpress" and "www.newdomain.com" with relavant old domain address (as an example http://localhost/wordpress) and new domain address (as an example http://www.test.com).

No comments:

Post a Comment