WordPress.org

Support

Support » Multisite » From Subdirectories to Subdomains, how to change WPMU after the MU install

From Subdirectories to Subdomains, how to change WPMU after the MU install

  • I changed my site from EXAMPLE.COM/USER to USER.EXAMPLE.COM in my WordPress MU install… Perfect for (very) small networks – not so good for large networks.

    How it works

    Many WordPress Network Administrators are familiar with the following:

    Addresses of Sites in your Network

    The primary information in this section involves the decision to use sub-domains or sub-directories for your sites. This means each additional site in your network will be created as a new virtual sub-domain or sub-directory. Please choose whether you would like sites in your WordPress network to use sub-domains or sub-directories. You cannot change this later.

    YOU CAN CHANGE IT!

    This is a quick tutorial for for medium to advanced WordPress Network (MultiUser) administrators.

    Problem: I installed the WordPress Network (WordPress MU) with user SubDirectories instead of SubDomains. Now, I want to change it. My host provider allows wildcard subdomains (http://*.example.com) so how do I fix this?

    Solution: After looking online at the wordpress.org forums – like here and here – I stopped at this post, Adam Wulf’s, Changing WordPress Mu from Subdomains to Subdirectories. Then it hit me.

    First, I created wildcard subdomain (as I said before, my host provider allows wildcard domains and documentation how to enable it). Next, I went to my ‘wp-config.php” and changed following line from:

    define( 'SUBDOMAIN_INSTALL', false);

    To this line:

    define( 'SUBDOMAIN_INSTALL', true);

    Then (for larger networks, this is not the best solution), I went to Network Admin > Sites page. I noticed that the values for Domain have reset to the default domain. I clicked on Edit, under the Domain value.

    For each site, I changed the Domain field from the default example.com site to the new site.example.com site (I used the value in the Path field, making sure I kept the “/” symble in the the Path field).

    I tested the WordPress site and everything is in working order. This was an issue I was able to correct rather quickly after initial install, so as I said before, larger networks would not benefit from this solution. If you have done this, and have some comments, please let me know how it went for you.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Andrea Rennick

    @andrea_r

    Customer Care at Copyblogger Media and Studiopress

    I actually post how to do this all the time, but recommend not using the sub-blogs or doing this after you have established sub blogs.

    Funnily enough, I had a post on draft for a long time with how to do this and finally scheduled it for next Tuesday.

    i didn’t know where else to post this jem…i’ve been working on WP for a long time but only have posted here a few times. i’ve been thinking of being a bit more active in the community 🙂

    i agree not to use sub-directory blogs. if your host provider allows wildcard domains, then go wild!

    Andrea Rennick

    @andrea_r

    Customer Care at Copyblogger Media and Studiopress

    i agree not to use sub-directory blogs.

    Actually, I said to not use the sub-blogs you created in one format after switching to the other format – unless you wanted to change the URLs.

    Some people in stall one format only to discover it’s not working right (host doesn’t have wildcards & they didn’t check first, rewrite rules refuse to work for subfolder blogs..) and that’s one big reason they may need to switch.

    When you have established sub-sites in any format, and then switch, you *will* get a nasty drop in SE.

    Hi,
    This didn’t work for me. However, the line “define( ‘SUBDOMAIN_INSTALL’, false);” was not already in the config file. We’re running 3.1. Any ideas?
    Thanks

    http://codex.wordpress.org/Create_A_Network

    I followed the instructions here to create the network. From Sub-Dir to Sub-Dom is another deal.

    the line "define( 'SUBDOMAIN_INSTALL', false);" was not already in the config file.

    I believe you have to add them from your Network Admin Dashboard. Go to your Dashboard, go to Network Admin > Settings > Network Setup. There’s a code you have to copy and paste into your wp-config.php file and another code for your .htaccess file.

    Hope this helps

    I appreciate know that I can change from subdirectory to subdomain. However, some items in your description are leaving me puzzled.

    “First, I created wildcard subdomain…”

    Did you mean subdomain(s)? Either way, what do you mean? I understand the concept of wildcard subdomains, but I have MU with one site as the main site (I stupidly set it up initially with subdirectories): mainsite.com and 5 “underneath” it; mainsite.com/1 – 5. I want to domain map and the setup using subdirectories doesn’t work. SO… do I set up a wildcard sub on each of the underlings? Or, just for the main site?

    What do you mean by this: (I used the value in the Path field, making sure I kept the “/” symble in the the Path field)? Do I leave the path alone with what was there originally?

    I hope you will see this soon as I have already mucked some things up.

    bodyworkmentor – Please make your OWN post.

    If you set up your site for subfolders, you can still map domains. They work just fine.

    I don’t understand what you mean by making my OWN post. I’m trying to follow the instructions for the tutorial above and I have questions regarding THAT tutorial.

    And, btw, they don’t work fine which is why I’m pursuing changing to subdomains.

    Andrea Rennick

    @andrea_r

    Customer Care at Copyblogger Media and Studiopress

    Make your own new thread here in the forums.

    If you have a subFOLDER setup then you do not need the wildcard subdomains.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘From Subdirectories to Subdomains, how to change WPMU after the MU install’ is closed to new replies.
Skip to toolbar