Thursday, June 26, 2014

Bluehost subdomain for WordPress Multisite domain mapping

This is a geek-post, unrelated to permaculture or resistance. I couldn't find this information when trying to set it up, so wanted to document it here.

There are some guides (try here and here and here and here) to configuring the WordPress MU Domain Mapping plugin, but they don't address Bluehost specifically, and several of them refer to using cPanel to Park Domains, creating wildcard subdomains, registering a domain specifically to handle multisites, moving your domain website into a subfolder to use the root folder for the multisites, and so on. I think I found a simpler way.

Bottom line: it is possible, on Bluehost, to use a subdomain of your domain to host a WordPress Multisite Network, and you can set it all up in any subdirectory so it doesn't interfere with your regular domain. The multisites can be mapped to any domains or subdomains you own. You don't need to register a separate domain or change your existing file structure.

I won't try to recreate a guide for the steps to install WordPress multisites, the Domain Mapper plugin, or how to configure them for general use. I'll just lay out the important points related to configuring as described above. I'll use "mydomain.com" as the domain you already have.

Basically we're going to point all domains and subdomains to a single multisites subdirectory containing the WordPress multisite install, and then tell the Domain Mapping plugin how to sort everything out:

  1. In cPanel->Domain manager->Subdomains, create a subdomain such as multisites.mydomain.com and set the Document Root to something like /public_html/multisites
  2. Install WordPress Multisites on the new subdomain, using the subdirectory method for separating sites, not the subdomain method. So it'll create http://multisites.mydomain.com/site1 http://multisites.mydomain.com/site2 http://multisites.mydomain.com/site3 etc
  3. Install the domain mapper plugin
  4. For any domain you want to use with the Multisites Network, in cPanel->Domain List, set the domain as an Addon using the /public_html/multisites directory. For example, you may have myseconddomain.com as an Addon, using /public_html/multisites as its directory. cPanel seems to require that you also create an alias subdomain from your primary domain pointing to this addon. It shouldn't matter what you call it. You could use seconddomain.mydomain.com
  5. For any subdomain you want to use with the Multisites Network, in cPanel->Domain Manager->Subdomains, create the Subdomain using the /public_html/multisites directory as the Home folder (aka Document Root.) If a subdomain already exists and you want to change the Document Root, Remove and recreate it.
  6. In your Multisite install, from My Sites->Network Admin->Sites, "Add New" site for each domain or subdomain. It doesn't really matter what directory name you specify for the Site Address.
  7. In the Domain Mapping plugin, accessed either from Network Admin->Settings->Domains or from a Subsite->Dashboard->Tools->Domain mapping, add each domain and/or subdomain you want to use with the site. Set the desired one as "Primary". You should wind up with something like: http://myseconddomain.com (Primary), http://seconddomain.mydomain.com, and http://multisites.mydomain.com/site1

Now when you access the site from http://seconddomain.mydomain.com or http://multisites.mydomain.com/site1, it should redirect the browser URL to http://myseconddomain.com (whatever you set as Primary).

I did run into a problem with a domain I was transferring from another registrar, that I already had set up in the Domain Mapping plugin, but wasn't being picked up properly. I think I had to remove and re-add the domain name within the Domain Mapping area to get it to work.

This will leave you with a WordPress site at http://multisites.mydomain.com which I don't think you can map anywhere else. You can either use the site for something serious, use it as a placeholder to link to your various sites, or update the sample post to say "Ignore this site." and set it so that search engines don't index it.

Feel free to ask questions in the comments, but I can't guarantee that I'll respond. Tech support on this is not a priority for me. Sorry!

No comments: