Forums

Updating links after moving WP to a new subdomain (3 posts)

  1. huji
    Member
    Posted 1 year ago #

    I moved my blog from old.domain.com to new.domain.com successfully. Everything is working perfectly, and my only concern is that internal links in the older posts are still linking to http://old.domain.com/?p=123

    These links work right now because I am using an .htaccess with mod_rewrite. However, I want to update the links so that I can retire the mod_rewrite redirects some time in the future.

    So the question simply is: How can I update the links in many posts automatically, so that instead of linking to http://old.domain.com/?p=123 they link to http://new.domain.com/?p=123

    I have access to the DB via phpMyAdmin, and I'm also fine with installing any required plugins.

    Please advise

  2. sabinou
    Member
    Posted 1 year ago #

    I suppose your posts do not contain relative hyperlinks ( ../ ) but absolute urls, then ?

    If so, here is the solution for you : http://lorelle.wordpress.com/2005/12/01/search-and-replace-in-wordpress-mysql-database/
    I reguarly do that, it works perfectly for only editing all the posts.

    I didn't do intensive testing, but it seems it cannot replace complex HTML code lines (making sql recognize html tags as html tags and not as conditional terms must be tricky, I suppose), however, replacing an URL with another is perfectly fine.

    Backup first, as always.

  3. huji
    Member
    Posted 1 year ago #

    Thank you. I used the replace query and made sure all links are relative. Then I purged the cache.

    Will that update the RSS feeds automatically?

Topic Closed

This topic has been closed to new replies.

About this Topic