WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Domain migration (4 posts)

  1. TheDegree0
    Member
    Posted 4 months ago #

    Hello,
    I tried to move my wordpress website from a from an old domain to a new domain, I also changed the hosting provider.
    Everything is working perfect, I went to the database and changed everything that contained the old domain to the new one.
    The website works except when you visit the main page, it redirects you to the old domain. I'v been now 4 hours with this problem and I can't fix it and I have no idea why its happening, it only happends when you visit the main page, with everything else it works perfectly.
    I also tried of adding this lines to the wp-cofig.php file:
    define('WP_HOME','http://www.newdomain.com');
    define('WP_SITEURL','http://www.newdomain.com');
    but it didn't fix the problem.

    Im not sure if this goes here,
    Thank you,
    TheDegree0

  2. Keith Driscoll
    Member
    Posted 4 months ago #

    You could try this plugin http://wordpress.org/plugins/search-and-replace/ to search the DB for the old URL.

    In the future you may want to use a plugin such as Duplicator.

    Hope that helps :)

  3. Senff
    Member
    Posted 4 months ago #

    Instead of the two DEFINE lines in your wp-config.php, try adding these (at the bottom):

    update_option('siteurl','http://www.newdomain.com');
    update_option('home','http://www.newdomain.com');

    If that works, you can/should remove those lines again.

  4. TheDegree0
    Member
    Posted 4 months ago #

    Thank you! At the end it was a cache problem with my router.
    I'll try the Duplicator next time I have to change domains, thank you! :)

    I tried the update_option thing but it was creating PHP errors. It said that "update_option" is not defined.

    Thank you!

Reply

You must log in to post.

About this Topic