WordPress.org

Ready to get started?Download WordPress

Forums

302 Redirects when changing network URL (7 posts)

  1. kojix
    Member
    Posted 3 years ago #

    I've tried to move our intranet test site to our external server.

    I've trespassed the database and the files, i've also configured the virtual host.

    In the database, I've changed the wp_options for home and site_url to the new address but when I access the site new URL, I'm 302 redirected to the intranet site...

    Someone knows what could be happening?

  2. You have to change more than just those two values. Do a search on the db - the URL is stored in a multitude of places.

  3. Also watch out if you changed the folder location.

    You will want to check the wp-config.php and .htaccess files as well.

  4. kojix
    Member
    Posted 3 years ago #

    Uou, that's bad news...

    Shouldn't this be a global parameter (wp-config)?
    If some day we have to change the URL for all our weblogs network this is going to be a nightmare :S

    Thanks for the info, I proceed to the change...

  5. If some day we have to change the URL for all our weblogs network this is going to be a nightmare :S

    yes, it;s a fun job. ;)

    tho when you have thousands of users, they usually revolt if you change their blog address on them. knocks out their SEO skills. ;)

  6. kojix
    Member
    Posted 3 years ago #

    Just if can be useful for someone, the modifications from Changing the site URL seems to be a bit out of date...

    UPDATE wp_site set domain='newdomain.cat' where id=1;
    UPDATE wp_options set option_value=REPLACE (option_value,'olddomain.cat','newdomain.cat') where option_name='home';
    UPDATE wp_options set option_value=REPLACE (option_value,'olddomain.cat','newdomain.cat') where option_name='siteurl';
    UPDATE wp_blogs set domain='newdomain.cat' where domain='olddomain.cat';
    UPDATE wp_posts set guid=REPLACE (guid,'olddomain.cat','newdomain.cat');
    update wp_sitemeta set meta_value='http://newdomain.cat' where meta_key='siteurl';

    With this you can see where is the old domain in wp_options...

    SELECT option_name from wp_options where option_value like('%olddpmain.cat%');

    And then you can change the different options with:

    UPDATE wp_options set option_value=REPLACE (option_value,'olddomain.cat','newdomain.cat') where option_name='xxxx';

    And the same for the path (if changed)

    select * from wp_options where option_value like ('%/your/old/path%');

    And change it with

    UPDATE wp_options set option_value=REPLACE (option_value,'/your/old/path','/your/new/path') where option_name='xxx';

    If you have a blog network, you'll have to do this for each blog tables!! (luckily i was trespassing our test site to production, and we only had 2 fixed blogs...)

    I also made a search (grep) in the WP directory, themes and plugins, looking for the old path and domain, and changing if some appearance.

    For example, i did some changes in (if you have some cache plugin):

    wp-content/advanced-cache.php

    Hope it helps...

  7. You can login to the codex with the same username & password as you do for the forum here.

    Then you can update that page. :) Would be much appreciated, thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic