WordPress.org

Ready to get started?Download WordPress

Forums

Move blog from /site to main directory (4 posts)

  1. press_ppm
    Member
    Posted 1 year ago #

    Hi,

    I have a blog that I have built that is in a sub-directory folder:
    mywebsite.com/site

    However I want to move so it's in the main folder:
    mywebsite.com

    How do i move it all over?

  2. Prometheus Fire
    Member
    Posted 1 year ago #

    Simply copy all the files and directories to the public_html/ folder. As long as you don't have any customized file directory pointing in your install this should not break anything. The caveat here is that unless the current URL to your site is http://mysite.com/site then you probably have a domain redirect or parked domain pointing your domain name to mywebsite/site which is actually on your cpanel seen as /public_html/site. That needs to be fixed and removed.

    Do you currently have a website or something located at mysite.com?

    If there is nothing there then the process is simple, but if there is already a website there (in the /public_html/ folder) then you need to deal with that one first and get it out of the way.

    If none of this makes any sense to you at all, contact tech support at your host and have them help you with it. It's the sort of thing that is typically handled at that level.

  3. press_ppm
    Member
    Posted 1 year ago #

    Hi,

    I managed to get it working by deleting everything on the public_html (apart from the /site) then copied all the contents of /site into the public_html.

    However before i delete the /site folder i have noticed that all my images are stored in the site/ folder. How do i re-link them to the new versions in public_html.

  4. Prometheus Fire
    Member
    Posted 1 year ago #

    One way would be to download all the images to your computer and then use the bulk media uploader to put them into the new website. Trouble there is that you then need to reset them into your existing posts manually. If you have a large site, that would take a while.

    Another option would be to leave them where they are, delete all the other stuff from the /site folder and forget about them. Your new site will continue to use those as the paths are already present in the existing posts. Any new posts should use the new path location for the new website in your public_html/ folder.

    Another option would be to delete all the posts and media from the new site. Then run the Export script on the old site located at Tools -> Export. Then import that file (thus restoring all the posts you just deleted) into the new site, ensuring that you select the option to download and save all the attachments into the new site. Once that is done, go into the posts and check the image paths to ensure they are showing the new one.

    Lastly, there may also be a code-based method such as in htaccess or a php script but that is going to be help beyond what I can offer.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.