• Hey, I am trying to set up a multisite network of two websites that have different domain names (e.g. mysite.com and blog.com). The two original sites are currently live (and using those domain names) and need to stay live until I have built brand-new sites to replace them. I understand that my options are to either build my new sites on a local server or to build them in a subfolder on the hosting server of one of the old sites. However, that will mean that the normal subdomain setup options for the network won’t be available. Is there are way around this so that my end product is still going to be a multisite network containing two sites with distinct domain names? And since my domain names are both currently in use on live sites, I assume the transfer of the domain names to the new sites will happen as a final step at launch, right?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator bcworkz

    (@bcworkz)

    Multisite often doesn’t work correctly unless it’s a root installation. What you can do, is do a staging subfolder installation, and use VirtualHost to cause that subfolder to appear as the root folder for the staging sub-domain. You can then later alter VirtualHost to use the eventual production domain. Or move the installation to true public root (/public_html/ in many cases).

    Either way, the domain names you’ve used in the staging version need to be updated in the DB to reflect the production domain. There is a way to avoid this if you are able to develop locally. Alter your local computer’s hosts file to point the production domain to 127.0.0.1. This overrides the usual DNS A record. Restart your computer. You will no longer be able to access the current production site from this computer until you again alter the hosts file. But now the local DB will already have the correct domain name in the DB so when you migrate to production the DB will already be correct.

    Are the 2 sites all that the network will be used for? Or will more be added? Personally, for 2 sites, I’d rather have 2 separate single site installations than use multisite. Multisite involves some quirks that I’d just as soon avoid. I might even consider 3 individual sites. 4 or more however definitely calls for multisite, IMO of course.

    Thread Starter gemful

    (@gemful)

    Thank you @bcworkz! This is incredibly helpful and has also made me rethink proceeding with multisite. Sounds like there will be a number of aspects of the network that might be outside my current skill set. Yes, only 2 sites so it’s probably not worth the headache. I will still give the option to my client to purchase a third domain and build a network inside that root folder and then domain map their two existing domains to the two subsites- I assume that’s a less complicated option, right?

    Moderator bcworkz

    (@bcworkz)

    Through the hosting account and VirtualHost, you can map any domain or sub-domain to any server sub-folder. For that domain, its sub-folder will appear to be public root. Its true server path may be public_html/example.com/ but to all outward appearances it’s as though example.com’s core files are in public_html.

    I don’t think there’s any reason to purchase a third domain simply so the existing ones could be mapped to its network. Only do so if the third domain has some desirable marketing or promotional purpose. What I recommend depends on whether you will stay with a network concept or just use to independent single sites on the same server.

    You can assign a new sub-domain to either existing domain and map it ((in hosting, not multisite)) to a sub-folder to use as a staging site on which to develop the new sites. This will work for either network or single sites. When the time comes to launch, convert the root folder installation to multisite if it is not already and that is what is desired. Update its wp-config.php to point to the staging DB that will become production. I’m assuming here that the current sites are also WP based. If not, the site will need to be down for a short time to move files around to effect transition from old to new.

    Do a search/replace on the DB to update all staging domain references to be production instead. If you decide to keep two single installations, you can re-map (again, in hosting, not multisite) one production domain to what was initially a staging sub-folder. Again, update the staging domain references in the DB to become production.

    Personally, I don’t like developing on a staging site, I much prefer to develop locally. The main drawback is clients don’t have access to my local environment. I will need to migrate everything at some point to a staging site for client approval prior to launch. For launch I either migrate again to production or re-map the existing production domain to the new site’s current staging sub-folder through its hosting configuration, in essence altering VirtualHost configurations.

    This probably all sounds horribly complicated. It really isn’t, but it’s difficult to explain. If you’ve not done this sort of thing before it can seem overwhelming. Once you look back after having gone through the process I think you’ll agree that it really isn’t that complicated.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Creating a custom domain multisite network in a subfolder’ is closed to new replies.