• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Move site from subdomain to root

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Move site from subdomain to root

This topic is: resolved

Tagged: redirect

  • This topic has 10 replies, 4 voices, and was last updated 8 years, 11 months ago by sundara.
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • October 16, 2013 at 9:28 am #66993
    chantal2012
    Member

    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 #67668
    Anita
    Keymaster

    Send me an email. I will walk you through it.


    Love coffee, chocolate and my Bella!

    October 20, 2013 at 8:00 am #67813
    chantal2012
    Member

    Thanks @anitac.....I figured it out finally! 🙂

    October 20, 2013 at 9:38 pm #67931
    dev
    Participant

    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:
    http://interconnectit.com/products/search-and-replace-for-wordpress-databases/
    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.

    Dev
    http://www.NewMediaWebsiteDesign.com

    May 2, 2014 at 4:33 pm #103371
    sundara
    Member

    Hi Dev,

    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?

    Thanks,
    Conny

    May 2, 2014 at 9:39 pm #103389
    dev
    Participant

    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
    sundara
    Member

    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?

    Thanks again,
    Conny

    May 3, 2014 at 8:20 am #103441
    dev
    Participant

    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."

    Dev
    NewMedia Website Design

    May 3, 2014 at 8:58 am #103457
    sundara
    Member

    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.
    Conny

    May 3, 2014 at 9:22 am #103458
    dev
    Participant

    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]

    Dev
    NewMedia Website Design

    May 3, 2014 at 12:18 pm #103477
    sundara
    Member

    Thanks again, Dev. I appreciate your thought process and will give it a try at my end.

  • Author
    Posts
Viewing 11 posts - 1 through 11 (of 11 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble