WPMu Subdomain Mapping

As a follow up to my last post, I also tested out mapping subdomains with CPanel on a WPMu installation using Donncha’s Domain Mapping plugin. And surprise, surprise, just about the same method works for mapping just a subdomain to a blog on WPMu. To clarify, when I say mapping just a subdomain I mean mapping just one part of a domain, rather than the entire domain. For example, I don’t want the domain jimgroom.org to only host one WordPress blog because I plan on using this domain name for other things like a MediaWIki or even Drupal installation:) So, all I do is create a subdomain such as blog.jimgroom.org and map that to a blog on my WPMu installation.

Assuming the domain is already pointed to your host and you are using CPanel like me, just create the subdomain and point the document root to your WPMu installation. In the following example I added a subdomain blog to jimgroom.org and then pointed it to my WPMu installation using the Document Root field (which is at public_html/wpmued-org for my personal installation).

After you do this, you can map subdomains for all your favorite domain names to one WPMu installation and save yourself the headache of updating numerous blogs on numerous domains that need numoerous updates and themes and plugins and whatnot. One installation to rule them all!

This entry was posted in , wpmu, wpmu development. Bookmark the permalink.

3 Responses to WPMu Subdomain Mapping

  1. Ted says:

    This is exactly what we are trying to accomplish but we have a few drawbacks:

    1) each addon domain costs us money while we have unlimited parked domains

    2) our WPMU is in a subdirectory of our public_html, therefore not the default domain

    I’ve setup a subdomain pointing to the WPMU installation in our subdirectory… but now how do I get the user’s domain to work correctly if I can’t use addon domains

    is this possible?

  2. Reverend says:

    Hi Ted,

    Odd that your hosting service charges for addon domain, through Bluehost (which is dirt cheap) you get unlimited add-on domains and parked domains. How much do they charge for each addon domain?

    As for your WPMu in a subdirectory, that shouldn’t matter too much, is your WPMu using subdomains or subdirectories? This plugin only works with subdomains, FYI.

    It would look like in the document root field: public_html/your_directory/your_subdirectory

    Just be sure to point the root field to the propoer directory path.

    Also, Donncha has this to say, which may make your life easier:

    The IP address textbox only shows to the site admin. Once it’s filled in, it’s displayed to “normal users” who must add CNAMEs or A records to their DNS pointing at that IP address.

    There’s no need for your users to change domain servers, but of course this will only work if you only have one IP address.

    Best,
    Jim

  3. Ted says:

    Thanks Jim.

    I was able to get this working using parked domains rather than addon domains.

    I just had to write an .htaccess rule to forward all domains (that we’re not my main website domain) to my WPMU subdirectory:

    # redirect any non-mainwebsite URL to WPMU subdirectory
    RewriteCond %{HTTP_HOST} !^www.mainwebsite\.com
    RewriteCond %{REQUEST_URI} !wpmu_subdirectory/
    RewriteRule ^(.*)$ wpmu_subdirectory/$1 [L]

    with this rule in place all I have to do is park every new domain rather than write a new line into the .htaccess file everytime.

    -Ted

Leave a Reply

Your email address will not be published. Required fields are marked *