Community Forums › Forums › Archived Forums › General Discussion › Move site from subdomain to root
- This topic has 10 replies, 4 voices, and was last updated 8 years, 11 months ago by sundara.
October 16, 2013 at 9:28 am #66993chantal2012Member
As a custom wordpress designer, I'm ashamed to say that I've never learned how to migrate sites. I've just finished re-designing my new site at test site and I need to move it to the root where my old site is. Can anyone recommend an awesome step by step tutorial or video for this? I've done some research and it all seems so confusing!!!October 19, 2013 at 9:56 am #67668AnitaKeymaster
Send me an email. I will walk you through it.
Love coffee, chocolate and my Bella!October 20, 2013 at 8:00 am #67813chantal2012Member
Thanks @anitac.....I figured it out finally! 🙂October 20, 2013 at 9:38 pm #67931
We put ALL of our sites into subdirectories and just make a simple change to index.php in the root. Often our clients have a ton of stuff in their root... often old Joomla files or old WP files or who knows what. We want to keep our work separate so we always install in a sub.
If you must migrate a site, you absolutely want to run the database search-and-replace tool from Interconnect:
to change the URL.
Why? Because often URLs are serialized in the database and a normal text-based search-replace of a dump file will break the database because it changes the string-length. This tool will not do that. I think it is even recommend by the WP Codex site.May 2, 2014 at 4:33 pm #103371
I just found this thread as I am having difficulty migrating a WP site to root myself (see http://www.studiopress.community/topic/problem-moving-site-from-foler-to-root-directory/).
I am intrigued by the idea of leaving the WP site in the subdirectory, but having it act as if it was in root. Is it possible to do so that all URLs resolve to root rather than having the subdirectory name in between?
If so, could you tell me how to do that?
ConnyMay 2, 2014 at 9:39 pm #103389
Sorry, no way I know to have the WordPress in mydomain.com/wp but have the URLs in the browser window just show the domain without the subdomain (/wp.)
Why would you want to do that anyway? No one cares if the URL shows a subdirectoy.
Maybe there is an Apache .htaccess rewrite directive that will do what you want, but beyond the basic .htaccess commands, I can't be of any assistance.May 3, 2014 at 5:01 am #103433
Thanks for your feedback, Dev. I thought that might be the case.
Can you please tell me then what needs to be in the index.php in root for the scenario that you use?
ConnyMay 3, 2014 at 8:20 am #103441
As noted, our shop always builds its sites with a new install of WP in a sub-directiory. We never build in the root. We have lots of reason to do that but they are not relevant to this thread.
So, if the domain is "www.SomeDomian.com" we will install WP and build the site in "www.SomeDomian.com/wp"
Of course we don't want anyone to have to key in the sub-domian as part of the URL.
In order to get the viewer (browser) to 'jump' to the sub-directory when "www.SomeDomian.com" is entered we use the simple redirect in the .htaccess file that we put in the root directory. (If you are not familiar with the .htaccess file just research it... tons of info on it out there... easy to create and use.)
Redirect 301 /index.php http://www.somedomain.com/wp/
(you need at least one space between the arguments of the command.
This basically tells the browser "Yo. Browser. Don't load the index.php in this directory but jump over to the '/wp' directory and get that one instead."May 3, 2014 at 8:58 am #103457
Thanks again for your detailed explanation, it is much appreciated.
I understand the process now and will give it a try (even if I do not fully understand all the reasons for wanting to leave the sites in a subdirectory).
Thanks for all your assistance.
ConnyMay 3, 2014 at 9:22 am #103458
Basically we build out all our sites in a sub-directiory because it is more flexibile and less cluttered. We often get clients who need 2 sites... one for most of the year but one they only run for 4 months during the holidays or during an election or during the summer (season) etc.
Yes, the WP Multisite woud be ideal, but that's an added learning curve and level of complexity our clients don't want or need.
They can have a web person working on the second (i.e. 'holiday') site while the regular site is up and running. Yes, there is duplication of data and yes there are other ways of doing this, but having two build-outs is what works for our victims (oops, I mean clients!)
We also get people who come to us with maybe huge Joomla or Drupal install in their root... a hundred or so files. I don't want to erase those files even if they say they are not ever going to use Joom again... too much liability. And I don't want to add more clutter by installing WP there, so we install in a nice, new, fresh, clean, empty directory and just re-direct.
On a new client without a site we put in a tiny "common soon" html static page "system" (a few images, .css, .js, etc.) in the root while we build out in the /wp subdirectory. When ready to go live we just rename the "index.html" (very important you do that!!) to "index.html-not-used" and put in the .htaccess file with the redirect and that's that. If we want to go back to a 'coming soon" and make a "site is down for work" message it is easy to modify the "comming soon" flle, fix the index.html file and comment out the redirect in the .htaccess.
[Note: I am not preaching this method/practice. This work for us and our clients. YMMV]May 3, 2014 at 12:18 pm #103477
Thanks again, Dev. I appreciate your thought process and will give it a try at my end.
- The forum ‘General Discussion’ is closed to new topics and replies.