Home>Support>How to re-point a Url

How to re-point a Url

By Andrew, 9 years ago. Last reply by Andrew Misplon, 9 years ago.

Hi
I am working on a new site which is currently just contained in a subfolder of my live site, until it is ready to go live.

i.e. the WP files and login are housed in a ”testsite” folder. www.mylivesite.com/testsite/wp… etc.

When the new site is ready to go live, can I simply change the URL in the dashboard, so that the site now just points to the root of the URL? i.e. www.mylivesite.com/

And if I do that, where should a redirect the login/admin folders? (/testsite/wp-admin)
Should I leave those where they already are?

Thanks
Andrew

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 9 years, 7 months ago Andrew

    Is this an easy thing to do?

  2. 9 years, 7 months ago ThemeBuddies

    what I do when developing a test site on a test server is build it up like I want and then when it’s all done. Log into Cpanel and do a backup of the database. This will download a SQL file to your desktop. Then install WordPress where you want it, import the sql file to the new install and then you will need to run these queries on the database

    Once you do it a few times, it becomes easy. They change every instance in your database that needs to be changed from the old url to the new

    UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldurl', 'http://www.newurl') WHERE option_name = 'home' OR option_name = 'siteurl';
    
    UPDATE wp_posts SET guid = replace(guid, 'http://www.oldurl','http://www.newurl');
    
    UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldurl', 'http://www.newurl');
    
    UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.oldurl','http://www.newurl');
    
    
  3. 9 years, 7 months ago ThemeBuddies

    PS.

    Always make a backup of your site before messing with the database. Always Always.

  4. 9 years, 7 months ago Andrew Misplon
    Hi, I Work Here

    Thanks @ThemeBuddies, as always, appreciate the help!!

    @Andrew, just to add to this a little. It’s up to you. You can either have WordPress in it’s own folder or move WordPress to the root.

    Here is more:

    WordPress in it’s own folder:
    http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory

    OR

    Moving the WordPress to the root folder:
    http://codex.wordpress.org/Moving_WordPress#Moving_Directories_On_Your_Existing_Server

  5. 9 years, 7 months ago Andrew

    Hi. Thanks for the replies. I will skip SQL method as I am not familiar with running queries. To answer the other reply, I already know that I can have the files in any folder. But my real question begins the live site and moving the URL from its current hidden location to the root of the domain, when the site is ready to go live, it’s not about moving the folders. They can start where they are if they do not need to be moved.

    Can anyone else help please?
    Thank you
    Andrew
    ——-

    Hi
    I am working on a new site which is currently just contained in a subfolder of my live site, until it is ready to go live.

    i.e. the WP files and login are housed in a ”testsite” folder. http://www.mylivesite.com/testsite/wp… etc.

    When the new site is ready to go live, can I simply change the URL in the dashboard, so that the site now just points to the root of the URL? i.e. http://www.mylivesite.com/

    And if I do that, where should a redirect the login/admin folders? (/testsite/wp-admin)
    Should I leave those where they already are?

    Thanks
    Andrew

  6. 9 years, 7 months ago Andrew Misplon
    Hi, I Work Here

    Thanks for the feedback there. In my opinion, the easiest way to handle this would be to move WordPress into the root and change the urls. The steps to handle this are here:

    http://codex.wordpress.org/Moving_WordPress#Moving_Directories_On_Your_Existing_Server

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More