• Resolved cptkirkh

    (@cptkirkh)


    I have setup my wordpress on my own server. The url was as this example test.mydomain.com and i switched it to test1.mydomain.com and changed the name in WordPress address (URL) and Site address (URL). I also ran the following sql statements. and yet when i click on a post i get a 404 error directory not found. i did not change the location of the files just the url. What else do i need to do? Thanks.

    UPDATE wp_options SET option_value = replace(option_value, ‘http://www.old-domain.com’, ‘http://www.new-domain.com’) WHERE option_name = ‘home’ OR option_name = ‘siteurl’;

    UPDATE wp_posts SET post_content = replace(post_content, ‘http://www.old-domain.com’, ‘http://www.new-domain.com’);

Viewing 1 replies (of 1 total)
  • Have you already consulted the Moving WordPress Codex page?

    Whenever I move a WordPress install, I run 4 sql queries as follows, they might provide some help to you.

    UPDATE wp_posts SET post_content = replace(post_content, 'http://domain.com/beta/', 'http://domain.com/anotherfolder/');
    UPDATE wp_posts SET guid = replace(guid, 'http://domain.com/beta/', 'http://domain.com/anotherfolder/');
    UPDATE wp_postmeta SET meta_value = replace(meta_value, 'http://domain.com/beta/', 'http://domain.com/anotherfolder/');
    UPDATE wp_options SET option_value = replace(option_value, 'http://domain.com/beta/', 'http://domain.com/anotherfolder/');

    Hope that helps.

Viewing 1 replies (of 1 total)

The topic ‘change url’ is closed to new replies.