WordPress Multisite with Subdomains and External Domains on Dreamhost

Warning: WordPress multisite is not officially supported by Dreamhost. Also, multisite with external domains is not officially support by WordPress. Refer to the following information at your own risk. Your mileage may vary!

WordPress multisite is a great feature for those who run multiple blogs. Recently I was tasked to set up such a configuration on Dreamhost, only to find that multisite doesn’t play well when it comes to using subdomains (and by extension, external domains) in a shared hosting environment. According to the official documentation, you’ll need access to your Apache httpd.conf file for subdomains to work. For most shared hosting plans, it’s understandably not allowed. Fortunately for those of us on a budget, there are some workarounds.

Multisite with subdomains

Getting subdomains to work with multisite on Dreamhost is fairly straightforward, actually. There are two ways to do this — after you follow all the steps to set up multisite, of course. For the first method, create the subdomain in your WordPress admin, then create the same subdomain in your Dreamhost panel. Pick the option to fully host the subdomain, but point its web directory to your root domain. For example, if your root domain is domain.com, create subdomain.domain.com and set the web directory to domain.com, as shown in the screenshot:

Fully hosted subdomain

The second method is to set the subdomain as the mirror of your root domain.

Mirrored subdomain

There are no substantial differences, as far as I can tell. Then again, I haven’t done much extensive testing. The fully-hosted option gives you a bit more flexibility, I suppose.

Multisite with external domains

Getting multisite to work with external domains on shared hosting is trickier. One method requires a plugin, while the other does not. The plugin method worked much better for me, so skip down to that section if that’s what you’re looking for.

Without plugins

I found a post detailing how to set up multisite with external domains. It assumes you are able to create virtual hosts, but some of that information is still applicable to Dreamhost. Set up subdomains using one of the methods I covered just now. Then, edit the hosting options for your external domain to also use one of the two methods I described. Then, hop on over to Interconnecit’s post and skip to the section “Adding a new domain” and start from step 5. With that, multisite with external domains works, sort of. For me, I was not able to administer the new domain as a super admin and activate themes and plugins. There are workarounds (see the comments), but I really did not want to get into the habit of changing WordPress core files. That led me to the plugin.

Using the Domain Mapping plugin

This methods works by using the WordPress MU Domain Mapping plugin. WordPress developer Sam “Otto” Wood covers it in an excellent tutorial. Again, you’ll need to set up the hosting options for your subdomain and external domain using one of the subdomain multisite methods. I found that your subdomain needs to mirror your root domain, but the external domain can be either mirrored or fully-hosted using the root domains web directory. I found that the fully-hosted option worked better. To repeat: fully host your external domain, but point its web directory to the root domain, and have your subdomain mirror your root domain. Then follow Otto’s tutorial to map your subdomain to the external domain.

I have not tested any of these methods extensively, so I recommend backing up your site before you try any of this!