I recently wrote an article about how to use WordPress 3.0 multisite/network features. This feature is really cool but out of the box it only supports the multiple sites/blogs to be served on the same domain (networksite1.domain.com or www.domain.com/multisite1/). For some this may be fine but really most like you want to have unique domains for each individual site. In this article I provide a quick guide on how to set up multisite domain mapping in WordPress 3.0. Please note that you should not follow this tutorial if your WordPress 3.0 has not been configured to support multisites!
Before you do any mapping, you need to work with your host to make sure that the domains in question all point to the primary domain. In other words, let say your primary domain is [a].com and you want to map [b].com to the WordPress served on [a].com. Before you start this guide it is a pre-requisite that you have set up the DNS-records for [b].com. There is a short guide at the end of this article if you need assistance on DNS-configuration but you can also consult your hosting provider as needed. After all the DNS-configuration needed for this to work is quite basic if you know how DNS work.
The plugin is what later separates them out into the separate sites, but to do that, the domain needs to send you to the WP site in the first place. For this tutorial, we will be using the WordPress MU Domain Mapping plugin. This plugin allows users of a WordPress MU site or WordPress 3.0 network to map their blog/site to another domain.
Guide for setting up Domain Mapping
Step 1: Manual Plugin Installation
The Domain Mapping plugin is unlike most other plugins as you are not going to install it the traditional way using Plugins->Add New menu. It is a bit more complicated and you need to update configuration files manually and FTP access to update the files on your server.
Start now with downloading the plugin here. The plugin consist of two files that you need to put in the proper places. In WordPress 3.0 the wp-content/mu-plugins folder doesn’t exist – you need to create it. The first file to be uploaded is the domain_mapping.php file. This needs to go into the mu-plugins folder you just created.
The second file is the sunrise.php file and you need to upload it to the wp-content folder.
Step 2: Activate Sunrise
You need to edit your wp-config.php file placed in the WordPress root folder. In wp-config.php uncomment the SUNRISE definition line: define( ‘SUNRISE’, ‘on’ ); If this line does not exist, paste it in. (if you face any trouble at this stage check to make sure your apostrophes ( ‘ ‘ ) in the pasted code are the same type as the apostrophes in the rest of your wp-config.php file. If not you need to manually chance them in the pasted code.
This will cause WordPress to go load that sunrise.php file and use it, however if you have not installed the network features of WordPress this is where things will go wrong!
Step 3: Server info
Domain Mapping has now been installed and next you have to set up the basic configuration. Go to your main domain’s admin page and log in as an administrator. Then go to the new Super Admin->Domain Mapping menu.
There are two main options to choose from here. You can either put in the IP address of your server (as defined in your domain’s main A record) or you can put in a CNAME that points to your server. The IP address is what I would recommend you to use. If you are not sure about your IP-address you simply have to ping your domain. On Windows open a command window and write “ping <domain name>”. The instructions on the page are pretty good read them carefully.
Other options on this page:
- Remote Login – This will make your login pages for all sites redirect to your main site to do the actual login. The benefit of this is that when you log in to one, you log into all of them. The downside is that the URL changes to another domain in order to log in.
- Permanent redirect (better for your blogger’s pagerank) – This makes your subdomain or subdirectory sites redirect to their domains. You should leave this on.
- User domain mapping page – Turn this on if you want users to be able to put in their own domains for mapping.
- Redirect administration pages to blog’s original domain (remote login disabled if redirect disabled) – This makes all admin pages show up on the original domain instead of on the new domains. You need this enabled for remote login to work.
Step 4: Mapping the Domain
Before you can actually take a new domain into use on a multisite you need to do some configuration up front. When you purchase a new domain, you will need to update its DNS settings to actually point to the WordPress server IP or CNAME. On some hosting plans this is easy and there are good instructions on how to set it up. On others you may need to ask support to get assistance. I use a pure DNS hosting provider (separate to my web hosting) where I have full control of the DNS settings and setting up a new A Record is pretty simple. I have also tried it on smaller hosting solutions using their own home made software and here I found this kind of task really though. You may need to be patient because some domain updates takes quite some time to replicate to the many DNS servers on the Internet. This is controlled by TTL on the record and you my want to lover it to 10 min. when you are playing with the domain settings. There is a guide below on how to do this if you have cpanel.
There’s two ways you can actually map a domain to one of your sites. The user screen is the simplest way, if you left that option on before. Log into the site you actually want to map to a new domain. Easiest way to do this is clicking Super Admin->site->Backend.
Then go to Tools->Domain Mapping. What you need to do is to put in the domain name, set it as the primary and press add.
You need to be aware that if you didn’t get the domain (in the example testsite.com) pointed correctly to your WordPress server before doing this, then your site will not be accessible. So make sure that your domain is ready before doing this. If you in step 3 selected the fourth checkbox about redirecting admin pages to the main domain you will still be able to access the admin area for the site.
The other way to set domain mapping is through the Super Admin->Domains menu. Here you’ll find a list of sites and their ID numbers and you can map an id number to a domain name here.
The Tools approach found under the multisite is a simpler to use, but the super user version will allow you to map domains without visiting each site. You can also correct broken domain mappings from here.
Step 5: Seeing the Mapped Domains
After setting up the domain for a network site you will see that the domain mapping (column at the right) is shown in the sites listing. Go to Super Admin->Sites.
When you get this result your network site has been configured with a domain and is ready to use!
DNS Guide For Cpanel users
If your domain uses the name servers on your hosting account you should follow these instructions. If the nameservers are elsewhere change the A record or CNAME as documented above. Add a wildcard subdomain/virtual host record to your site’s DNS record in Web Host Manager (WHM). If you do not have access to WHM, you must email your web host and ask them to make this one change for you. Should be no problem:
- Go to “Edit DNS Zone” and select the domain of your WPMU installation and click “Edit”.
- Below “Add New Entries Below This Line”, enter in the first box (Domain) an asterisk: “*”.
- The second box, TTL, should be “14400”.
- The third box should be “IN”.
- Select A Record Type from the drop down “A”.
- And in the last box, paste in the IP address of your website/network.
From Cpanel, click on the “Parked Domains” under the “Domains” section:
- Under “Create a New Parked Domain” enter the domain name you want to add to your network.
- Click the “Add Domain” button.
- It should add the domain to the list of parked domains and under “Redirect to” it will say “not redirected”. That is OKAY.
- WordPress 3.0 Multi site Domain Mapping and Sub-domains: http://wordpress.org/support/topic/30-multisite-domain-mapping-and-subdomains
- Everything about Domain Mapping: http://premium.wpmudev.org/project/domain-mapping
- WordPress 3.0 Multisite and Domain Mapping http://frumph.net/blog/articles/wordpress-3-0-multisite-and-domain-mapping/
If you want to see more e.g. great website themes, these Restaurant Menu Templates might be what you’re looking for. Also take your time to browse these interesting HTC evo cases that will protect and personalize your cell phone.