Forums

Site URL Name Change (7 posts)

  1. mac2025
    Member
    Posted 4 months ago #

    I developed my site using a subdomain so I wouldn't affect the live site:
    So in my WordPress URL and Site URL I have: dev.mysite.com

    I went live yesterday and changed the WordPress and Site URL to mysite.com

    The problem I have is the links to photos, etc are still pointing to dev.mysite.com and now these photos do not show.

    I check the php wp-options table and the variables 'site' and 'home' are set to mysite.com

    Do I have to change these links manually on each page/post?

    Thanks for the help! Dan

  2. esmi
    Theme Diva & Forum Moderator
    Posted 4 months ago #

  3. mac2025
    Member
    Posted 4 months ago #

    Thanks you for your reply. After reading the post I see the following:

    --> Existing image/media links uploaded media will refer to the old folder and must be updated with the new location.

    Do I need to do this manually on each page/post. Is their an automated way.

    Thanks for your help!

    Dan

  4. govpatel
    Member
    Posted 4 months ago #

    You can do that in database backup database if you have not done a back

    UPDATE wp_posts SET guid =
    replace(guid, 'http://www.old-domain.com','http://www.new-domain.com');

    Put above code in Sql tab in database and change the urls to your urls and press Go

    this will change urls in posts and pages.

    If you have links internally within blog posts or pages with absolute URLs, these links need to be changed else they will point to wrong page Use the following SQL commands to fix all internal links to own blog in all WordPress posts and pages:

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

    Press Go

  5. mac2025
    Member
    Posted 4 months ago #

    Thanks! I'll give that a try.

    Just curious, is there a way to have WordPress use Relative links instead of Absolute links when using the "Add Media" button on Posts and Pages?

    Thank you
    Dan

  6. esmi
    Theme Diva & Forum Moderator
    Posted 4 months ago #

    No. Relative urls do not work well in WordPress.

  7. mac2025
    Member
    Posted 4 months ago #

    Thanks govpatel and esmi for your help!

Reply

You must log in to post.

About this Topic