Feedback Form
Customer? Login here
 

Using multiple Domains with WordPress MU

By default in WordPress MU, blogs can be username.yourdomain.com or yourdomain.com/username/. But what if you want select blogs to have their own domain? It’s actually easier than you think.

Overview:
- install a domain mapping plugin
- park a domain
- map a blog to a domain

First, get the WordPress MU Domain Mapping plugin. NOTE: this domain mapping plugin only works with subdomain installs.

You can download it from inside Wordpress MU using the plugin installer, but it will have to be moved from the plugins folder. In WPMU, there is another plugin folder called mu-plugins. This is for mu-specific plugins that will be run all the time. Plugin in this folder do not need to be activated and they will not show up in the Plugins list in the admin area.

Place the domain-mapping.php file in the mu-plugins folder.

There’s another file included called sunrise.php. Place this in the wp-content folder.

The file gets run before most of WPMU and handles the domain requests. In order for it to be recognized, we now have to edit the wp-config.php file.

In your Cpanel, go to the File Manager, and find wp-config.php in the public_html folder. Click on the filename, and then click on the Edit File option on the right hand side.

Most of the way down the file, under the language options, will be a line that is commented out, meaning it won’t run.
//define( ‘SUNRISE’, ‘on’ );

The two slashes (//) at the beginning of the line are what we need to remove.
define( ‘SUNRISE’, ‘on’ );

Save your changes. If you get an error, it will be because this file is created by the server on install, so you may not have permissions. Just ask support to make this change for you.

Before we map our domain to a blog, let’s set up our second domain so it knows where to go.

Login to your domain registrar, and change domain2.com’s nameservers to the same nameservers as your WPMU account. It will be something like ns102.wpwebhost.com & ns103.wpwebhost.com.

Now login to your control panel for your WPMU web account. In the main cPanel menu, scroll down to the Domains box. Click the “park a domain” icon.

parking

In the box, type in domain2.com, where domain2 is the domain you want to map. It should come back with a success. If not, you may have to wait a few minutes for the nameserver change to catch up.

Finally, we are almost at the best part. Login to the backend of the blog that you want to change the domain of.

(Using Donncha’s plugin, if you map a domain from the admin area of the main blog, you will accidentally change the main blog’s domain. This menu option is also available to the admin of the blog, not just Site Admins.)

Look under the Tools menu for the Domain Mapping sub-menu. It’s pretty straightforward.

DomainMapping

First, fill in the IP address of your site. You, as a site admin, will only have to do this once. We don’t have to worry about the rest of the instructions, because when we parked our domain on top of our WPMU install, that took care of it.

Fill in the domain name (domain2.com) and save. The screen will refresh and show the domain name as active on this blog.

Since we are still on the subdomain, visit domain2.com to confirm that everything is working as it should. Now any attempts to visit the original subdomain will be redirected to domain2.com. You can continue these steps for each domain you would like mapped to a corresponding sub-blog.

Posted by: Andrea Rennick

Andrea writes tutorials specifically for WordPressMU on her blog, WPMU Tutorials and is an active member in the WordPress community.

Similar Posts
Posted on September 10th, 2009

16 Responses to “ Using multiple Domains with WordPress MU ”

Sam Morris

When you say: “First, get the WordPress MU Domain Mapping plugin. NOTE: this domain mapping plugin only works with subdomain installs.”

I pressume that means this will not work with http://wordpress.caryacademy.org/subsite.

It only works with http://subsite.caryacademy.org/, right?

Thanks, as always.

Headache

I have a headache just reading this

Dabiel

How to find a cheap webdesigner anywhere in USA…

Decha Kunla

Really nice article, i read entries blog afternoon then add it to my bookmarks and wait for your next article, i plan follow as you.

Thanks so much
decha kunla

Heloise

Nice work,man…have submit to my Linkin account. More of my friends will see this post…great…They will interested it…Thanks.

uniq

i’ve got this installed and wp mu now reacts to domain2.com, however if i want to access the dashboard, it simply redirects to domain2.com/wp-login.php. I’ve also got BP installed and can see that this blog’s user is perfectly logged in, I just can’t access the dashboard – any suggestions?

uniq

finally got it working by completelye starting from the ground up again…

Tia

This is awesome. I’m wondering, though, if there is any sort of plugin (even if it’s premium) that automates it a little more? For example, if I as the admin must go into cPanel and park the domain, I might as well do all of the domain set up for the new blogs. Otherwise, they’re doing half the work and I’m doing half, and it’s likely to get messed up.

Is there any way to hide that plugin from the users, so that they cannot go in and modify the settings once they are set by me? I’m thinking that I would rather just have the whole thing blind to them – just give them a place to specify the domain they want, tell them the name servers and then do everything for them.

kartik

Hi,

I have a hosting account at godaddy – abc.com i added a new domain xyz.com and created folder – xyz

I installed wordpress in the xyz folder and pointed the domain to the same.

Now when i open xyz.com it is opening but shows loading from abc.com in the bottom plus when i open any other link it shows the root directory – abc.com/xyz

What are the steps to rectify this ?

UK

Its hard to believe this has to be such a difficult task with WPMU – its such a commonly requested feature that it should just be built in by default.

Rachel Shaw

reat Resource! I am adding your blog to my favorites, given my interest in finding domain names. One of the sites that helped me find great name suggestions was http://www.squadhelp.com. I got 400+ domain name suggestions in 2 days for just $50. They engage people across the world who submit ideas – and the best idea wins the award amount. It sure beats the time and energy I would have spent myself to come up with names. You might want to check them out

dwheeler

I get the Domain Mapping Configuration I put the information in. When I hit save, nothing happens.
I check the database and there was nothing entered in the wp_domain_mapping or wp_domain_mapping_logins tables.

Cathie Shead

howdy, many thanks.

Trackbacks

  1. Run Multiple WordPress Blogs on Single Installation|Multi Domains
  2. Run Multiple Wordpress Blogs with Single Installation
  3. Forum cheat sheet - WPMU Tutorials

Leave a Reply