WordPress.org

Ready to get started?Download WordPress

Forums

Moving site to a different URL (7 posts)

  1. theprimalguy
    Member
    Posted 12 months ago #

    When I set up my WP site a few days ago, I watched a video showing me how to install it and was advised to set up a folder in the root directory called 'blog' and install the WP files into this folder sitting under public_html. So the URL of my site is now http://www.theprimalguy.com.au/blog

    I now realise this was probably incorrect but am unsure how to go about fixing it. I have read this post - http://codex.wordpress.org/Moving_WordPress

    And it appears I need to move my WP core files to a new directory but I am unsure of what to do. I use the Filezilla FTP client but am a complete novice so don't want to stuff it up. Ultimately I just need the address of my site to be http://www.theprimalguy.com.au

    Any assistance would be greatly appreciated

  2. Pioneer Valley Web Design
    Member
    Posted 12 months ago #

    1. Contact your Web Host and ask how to point your domain to that folder.
    2. Correct the URL. http://codex.wordpress.org/Changing_The_Site_URL

    Those are the steps.

  3. theprimalguy
    Member
    Posted 12 months ago #

    Thanks very much for your reply Seacoast WD

    Once my web host has pointed the domain, do I just need to update my home and site url under settings>general or do I also need to do one of the 4 steps listed further on in that post? ie, update the wp-config.php file?

  4. Wil
    Member
    Posted 12 months ago #

    Hi @theprimalguy

    Use Seacoast Web Design's solution ^^ for a quick fix but that will keep your files in the /public_html/blog/ folder.

    I could technically tell you how to move the installation into the root folder but that may be too techy for you.

    As you've just installed the site a few days ago then you probably haven't put a lot of data into it.

    I would recommend reinstalling it into the /public_html/ and starting again.

    If you want to know how to move the files to the root folder so that you can remove the blog folder let me know.

    I does involve making changes to the database using phpMyAdmin.

    Wil.

  5. theprimalguy
    Member
    Posted 12 months ago #

    Thanks Wil for your advice.

    I would like a more permanent solution but I have invested many hours in the site so far so don't want to lose what I have done with installing themes, skin, plugins., widgets etc.

    I have access to phpMyAdmin so if you can talk me through it simply, I would be incredibly grateful

    Brad

  6. Wil
    Member
    Posted 12 months ago #

    OK - the quickest way to do this is to do it in two batches; files and DB

    I would zip/pack up your /blog folder just so that you have a backup in place.

    I'll assume you're using cPanel.

    Files:
    Move all of your files and folders from /blog to /public_html/ using File Manager on cPanel.

    You now need to change one file:
    .htaccess
    remove the /blog reference and save or if in doubt just delete it - WordPress will likely recreate it for you if you go into General > Permalinks and save the settings

    wp-config.php
    Remove any references to site relocation that you may have implemented from the codex link posted above.
    i.e.
    define('WP_SITEURL','http://yoursite.com');
    define('WP_HOME','http://yoursite.com');
    define('RELOCATE',true);

    Files done!

    Database:
    There are two ways of doing this. Lets try the simple approach first and see if it works for you.

    1st make a backup from phpMyAdmin - export all tables and save as a SQL files on your local machine.

    In phpMyAdmin, go to the wp_options table and browse the content.
    On the first page you want to modify the siteurl option_name. It's usually the first entry in the wp_options table.

    It will contain your site url along with the /blog/ reference. e.g. http://www.yoursite.com/blog/

    Remove the /blog/ addition so it reads:
    http://www.yoursite.com/

    Go to page 2 of the wp_options table and find the home option_name. (should be around option_id 37)

    Do the same as the above step by removing /blog/ from the url.

    OK - check the front end of your site. This is the quick way. Check to see if your images load in and the sidebars are there.

    If you have images missing etc then lets do the second method.

    Make a copy of the sql file you downloaded earlier.

    Open it up in a text editor and do a search and replace for:
    http://www.yoursite.com/blog
    with
    http://www.yoursite.com

    Don't use a trailing slash on both search and replace fields.

    Save the sql file.

    Go into phpMyAdmin and drop all the tables.

    Go to import and import the newly saved SQL file.

    Check your front-end site - should be OK.

    Now this method can make some of your widgets disappear from the site but they should be pretty easy to recreate.

    If things go pear-shaped you can always restore back.
    i.e.
    remove the wordpress files in the /public_html/ folder
    unzip the zip in the blog folder
    drop all tables in phpmyadmin
    reimport the original sql file back in

    I put together a slideshare for a WordPress meetup which contains most of this information:
    http://www.slideshare.net/gravitationalfx/how-to-move-wordpress-to-another-server

    It's about moving WordPress to another server but it mostly applies to moving from one folder to another too.

    Let me know how you get on. Get in touch with me through the limecanvas.com website if you get stuck.

    Wil.

  7. theprimalguy
    Member
    Posted 12 months ago #

    Wil you're a legend, thanks so much for your assistance. Having a few problems as per my email to you through limecanvas. Appreciate any advice

    Cheers
    Brad

Reply

You must log in to post.

About this Topic