First of all we need to check… You are running your WordPress website as a multisite right? Because if not then you won’t be able to install this plugin.
For using A Record setups, you also need to ensure you have a dedicated IP. This IP would fall onto your multisite setup. i.e. when you enter the IP you see your multisite.
Getting Set Up
1. So first and foremost go grab the plugin and then unpack it.
2. Once unpacked we need to upload this to your website.
Providing you have not changed your plugin directory path, then it will look like this:
You will want to upload your folder there, so log in through FTP or if you are on a local host then move that folder over.
The path will then be:
3. You will see in the /domain-mapping/ folder there is a file “sunrise.php”. We need to move that to the /wp-content/ folder.
4. Thats the files sorted and uploaded. Now we just need crack open your wp-config.php file located within the root of your WordPress installation. On a cPanel server that path might be:
You will have to enter the following line:
define( 'SUNRISE', 'on' );
You can pop that right under the WP_DEBUG option, so like this:
define( 'SUNRISE', 'on' );
If for some reason you don’t have the WP_DEBUG line, then providing it is just above the following code comment it should work well:
/* That's all, stop editing! Happy blogging. */
Note: If you pop this in the wrong place you will most likely find issues when adding a domain name to be mapped from your WordPress admin area.
5. Now pop over to your Network Admin area:
Admin » Network Admin » Plugins
And Network Activate the plugin.
We have the plugin installed now, so let’s get some settings done here!
6. Your admin settings are located in the Network Admin area:
Admin » Network Admin » Settings » Domain Mapping
On here you will enter the IP address which your end users will see within their own websites admin panel. This doesn’t really affect anything, it is really only for cosmetic purposes to inform your end users which IP they must use.
You will then see the option titled “Supporters Only” This actually refers to the integration with our Pro Sites plugin. So you could choose to charge your end members for the privilege of mapping their own domain. (Grab our Pro Sites as well Plugin for that).
The only other option here to choose from is how your end users will access your website administration area.
Domain Entered By The User – If a user has mapped a domain, then with this option enabled you and your users are able to access the admin area with both usersite.yourdomain.com/wp-admin/ and userdomain.com/wp-admin/
Mapped Domain – With this one chosen you and your users will access their admin area through whichever domain is mapped. Don’t worry if you use usersite.yourdomain.com/wp-admin/ then it will simply forward to userdomain.com/wp-admin/.
Original Domain – As it says, the original domain. So that would be usersite.yourdomain.com/wp-admin/.
Thats it, all setup and now you are ready to go!!
But…. But…. But…. What now!!!!
Thats your end of it done anyway. If you or your end user need to map a domain we first need a site. We won’t cover the whole creation of multisite and sub sites here. If you need help there then please pop over to our forums, we will gladly help you out there.
To add a domain name to your admin area is easy, but keep something in mind here.
WARNING: If in the previous steps you chose “Mapped Domain” as the method for accessing the admin area and the domain being mapped is either not resolving to your server yet or not resolving for another reason other than DNS propagation then that admin area will not be accessible until the domain name has resolved correctly. Choose another option if this bothers you. :-)
Adding a domain name which is not resolving correctly in this instance will make that admin area inaccessible. Honest, we warned you!! ;-)
So, lets go to a sub site which has it own domain to map.
Admin » Tools » Domain Mapping
In here you can add the domain to be mapped to your sub site. Once you click add then thats all you need to do from WordPress.
A Record & CNAME
If you or your end user wishes to map a sub domain to the blog within your multisite install then you can set up a CNAME
For the purpose of these instructions we will assume you are doing this through cPanel, however if you are using a different panel or managing the DNS with the domain name registrar then the principle is just the same, the method of adding it might be a little different.
If you cannot manage your own DNS then you would need to discuss this with whomever is currently managing it.
Even people on cPanel might not have access to the Simple and Advanced DNS options, this depends on your hosting provider. If you point your name servers to your host then it can be managed by your host or your cPanel. Again if you don’t have access, then ask your host.
CNAMEs are used for sub domain mapping. i.e. you want to map blog.userdomain.com to usersite.yourdomain.com
A Records are for mapping TLDs aka Top Level Domains. i.e. userdomain.com mapped into usersite.yourdomain.com
First we will handle a CNAME:
We will do this through Advance DNS, so click on that.
Select the domain from which you would like to enter a CNAME.
Now fill in the form. :-)
Name: the sub domain to be mapped. So blog.userdomain.com
TTL: You can set this to 14400. If you know what you are doing then please feel free to adjust this.
Type: CNAME of course ;-)
CNAME: Where it is going to, in the example above, we use usersite.yourdomain.com
Easy Peasy huh!
For A Record – Top Level Domains we go through the same process, except you will most likely already have the A record set (unless in instances where the domain is registered but not pointed anywhere)
So If its there click on EDIT for the main A record, and change that IP address to the dedicated IP for your Multisite install.
If you are setting up A record for the first time then the type is “A” A Record. Then rather than entering a CNAME it will be the Address field, which is for the IP Address.
Yeah there are, you can also use Addon Domains and Parked Domains. They must point to the root of your multisite installation in order to function correctly.
This method also does not require a dedicated IP address.
However its not recommended you use this method for client websites as you will have to manually control their DNS. You would need to deal with MX Records if they wish to use email on that domain as well as other DNS requests.
This is a good method if you own them all though, its quick and easy!
Remember the domain root needs to be your multisite folder which is usually:
Addon Vs Parked
There really is not much difference. If you want an extra FTP account then use Addon domains. Really you shouldn’t be handing FTP accounts out due to security concerns, so there isn’t much need for this. And all FTP is usually done through your main FTP account.
Parked domains simple does as it states, parks the domain onto a folder or redirect.
Again this will vary from control control panel to control panel.
I get a 404 or some sort of server page, why?
Chances are your not using a dedicated IP or you have some issue with your htaccess file, please check those out first.
You may also wish to double check your permalinks and re-save them again.
Why do I need a dedicated IP?
You only need a dedicated IP address when using A Records to map your domain. This is because the domain being mapped needs to land on your WordPress multisite install and if it doesn’t then our plugin and WordPress won’t know when to map it.
On shared hosting platforms, usually the sites IP address will fall on a landing page which is not related to your account in anyway.
Doesn’t this need to go into the MU folder?
Nope, you no longer need to do that!
If however you are running an older version pre-3.0.7 then you must remove those older plugin files before using the new version!
When I add a domain, the page just refreshes and nothing happens?
Chances are when you edited your wp-config.php to enter the sunrise information, you put it to far down. Check through these docs again and make the appropriate adjustments.
Nope that wasn’t it, the page still refreshes and nothing happens so what now sherlock?
Another cause of this is the sunrise.php file, if you are running our Multi Domain plugin:
Then you will find in the plugin folder an alternate sunrise file dm_sunrise.php you need to use this file.
First rename it to sunrise.php and then upload it just like the original sunrise.php file in these instructions and that should fix you up! :-)
Erm… Cookie syncing does not work?
Cookie syncing is where you log into your mappeddomain.com and subsite.domain.com at the same time. Its this process that allows you to administer and view a mapped domain website whilst being logged in.
Its not a process to log you into all mapped domains on a network install.
Anything else I need to do?
If you installed your WordPress installation as a subdirectory, then nahh nothing else there.
If you installed your WordPress installation as a subdomain version, then we assume here that you’ve already set up your Wild Card? Don’t worry if not, checkout WordPress for a walk through:
After adding a domain I can not add a second domain. Is this correct?
If you haven’t added anything to your wp-config.php then it’s limited to a single domain per site. If you add the following somewhere in it then you will be able to use multiple domains per site.
Arghhhhhh, I’m still stuck, what can I do?
Open a support ticket and one of our awesome support chimps will be right along to help you.
Obviously in peak and seasonal times, responses times will vary, but don’t worry, we will help you work through the issue.
WPMU DEV Community
On behalf of the Incsub and WPMU Dev we would like to thank you for being an awesome member of our community!