WordPress 3.0: Multisite Domain Mapping Tutorial
The other day, Klint Finley wrote a very good walkthrough of using the new Multisite functionality of WordPress 3.0. In the comments, a lot of people wanted to know how to use your own domain names. Since I’m doing that now, here’s a quick walkthrough/how-to guide.
Step 1: Manual Plugin Installation
The Domain Mapping plugin is not your regular kind of plugin. You cannot install it through the normal Plugins->Add New menu. Well, actually, you can, it just won’t work.
So first, download the plugin manually.
Note: For this tutorial, I will be using the WordPress MU Domain Mapping plugin. However, I am using the trunk version of the plugin. It has fixes in it that you will need for proper 3.0 support. Don’t try it with the regular version. (Note: The regular version works fine. This was originally written before the latest version, or 3.0, was released.)
The plugin has two main files you need to put in the proper places.
The first file is the domain_mapping.php file. This needs to go into the mu-plugins folder. The mu-plugins folder is a special folder, which you may not even have yet. Just create it underneath the wp-content folder and put that file into it.
The second file is the sunrise.php file. This is a special filename for WordPress. Don’t worry about it, just put it in the wp-content folder.
Step 2: Activate Sunrise
Now you need to edit your wp-config.php file. Add this line of code to it:
define( 'SUNRISE', 'on' );
Simple, really. This will cause WordPress to go load that sunrise.php file and use it.
Step 3: Server info
Now you have to configure the domain mapping plugin so that it knows what it’s doing properly. This is easy to do, really. Go to your main domain’s admin page and log in as a super admin. Then go to the new Super Admin->Domain Mapping menu.
Here you have a few different options, but two main ones that count. 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 most people will want to use. If your server uses more than one, you can enter them all here, separated by commas.
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.
Generally I leave only the middle two on. Remote-login is iffy at best, and I want my new domain name to show up everywhere.
Step 4: Mapping the Domain
There’s a bit of a prerequisite here before you do this. When you buy a new domain, you will need to edit its DNS settings to actually point to your server IP or CNAME or whatever you do to make the domain connect to your server. For me, I just give it a new A record with my server IP in it. Easy.
Update: Okay, so there may be more to it than just that, depending on your host. Every host is different, and you’ll have to talk to your host to make them able to point the domain name at your existing site. How to do this varies from host to host, but the important thing is that when you visit your new domain (before you do this!) then you want it to go to your main site, as is.
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, then go to Tools->Domain Mapping.
All you really do is put in a new domain and set it as the primary. Simple.
Note that if you didn’t get the domain pointed at your server before doing this, then your site will instantly vanish from the realm of mortal man. Setting the primary domain takes effect instantly. You won’t be able to access the site through the old domain any more.
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. You can map an id number directly to a domain name here. The Tools approach is a bit easier to use, but this will allow you to map domains without visiting them, as you can access this list from your main domain. You can also correct broken domain mappings from here.
Step 5: Seeing the Mapped Domains
If you go to Super Admin->Sites, you’ll find this type of a listing:
You’ll note that on the right hand side you can see the column showing the mapped domains.
Special Note: See in the picture how I’m using a subdirectory install? That’s relatively new. In older versions of the domain mapping system, you had to use a subdomain installation and wildcard DNS for domain mapping to work. This is no longer the case, domain mapping works just fine with subdirectories.
Conclusion
And that’s how it’s done. It’s not super complex, but it does require some knowledge of DNS and how servers work. If you can successfully set up a multi-site install to begin with, you can probably do this as well. Just be aware that it is slightly finicky, and know that you will break your site if you put in the wrong settings somewhere. However, your main domain will always be accessible as long as you don’t try to map it, so you’ll be able to go in from there to correct your mistakes.
[…] The best tutorial I found is located here. […]
[…] 2. Install the WordPress MU Domain Mapping plugin, from http://wordpress.org/extend/plugins/wordpress-mu-domain-mapping/. You need to do a manual installation, but it’s easy. For some additional information on this plugin, see http://ottopress.com/2010/wordpress-3-0-multisite-domain-mapping-tutorial/. […]
Hi!
I’,ve tried install my blogs into directory “www.domain.com/blogs/” and, after that plugin was installed, WordPress showed me this message:
“The domain mapping plugin only works if the site is installed in /. This is a limitation of how virtual servers work and is very difficult to work around.”
Is this have a solution?
Pablo:
Very simple.
You cannot add your WordPress files into a directory called “blog”.
Please move them up one directory into your “main” or what we call “root” directory.
Your root directory is what you generally see first when you FTP into your hosting account.
Root is – http://www.mysite.com/...
Not this – http://www.mysite.com/blog/...
If you already have files in your root directory for any other reason, and you have to mix your WordPress files in with those, then obviously that is problematic if you just want to keep a clean WordPress install. You should try to have a clean (meaning “empty”) root directory to install WordPress in, so that if you ever need to move it, you won’t be bogged down with a bunch of directories or files that you don’t need to move.
Thanks, Tony! I didn’t know there was this problem of nomenclature in the directories. I used “blogs”. Regardless, I will test with the name that you suggested.
For this case, I’ve installed it on another domain and it worked just fine. I’m just waiting for the DNS because I’m having problems in the mapping.
As Sahdow, HostGator is also my hosting provider. Maybe you can help me.
I installed the WP(MU) on http://rumoincerto.com.br. When I add my domain http://azul.blog.br as parked domain into CPanel, I need change the CNAME too or just wait?
I tried to access the http://rumoincerto.com.br/azul, but doesn’t activate the domain http://azul.blog.br and vice versa. My DNS Zone are:
Name / TTL / Class / Type / Record
azul.blog.br / 14400 / IN / A / 174.120.99.5
http://www.azul.blog.br / 14400 / IN / CNAME / azul.blog.br
The both domains are old and already were already propagated. Can you explain to me in detail what is happening? 🙁
You are not understanding me correctly.
You should not even have a nomenclature. Your “root” directory is the absolute top level directory that you put your files in. Simply add all “wordpress” files to the main directory of your web server. Do not upload the folder and its contents. Just upload the contents of the folder itself.
You should install WP network using and A Record for your primary domain pointing to the IP address of your server.
You should use CNAME records for all additional domains, pointing to the primary domain.
rumoincerto.com.br should have an A Record pointing to IP address.
azul.blog.br should have cname pointing to rumoincerto.com.br
Tony
Thanks again, Tony! I got it! Everything is working! 😉
Whats Is My IP Server Domain … ?
My CNAME ?
I Have Domain 2yum.co.cc
One thing I can’t figure out. All this is for configuring WordPress. What about domain setup? I also don’t undestand what would be CNAME. And secondly is this possible on shared hosting with shared IP address? Thank you in advance. BTW, this is great tutorial for configuring subdomains on GoDaddy
http://keithjameslock.com/wordpress-mu-with-subdomains-godaddy-shared-hosting/
1. “is this possible on shared hosting with shared IP address?”
No, not really…the domain mapping plugin REQUIRES a dedicated IP, what you could do is change this every time your host provider changes the IP. Keep in mind that you won’t know when they are changing it.
2. “All this is for configuring WordPress. What about domain setup?”
Domain setup is at the server level, call them, this is a WordPress plugin. Every domain provider is different. My setup was super easy! All I had to do was make a short-cut to the WordPress network.
This is alot easier when your not on a shared server.
The question really is:
“Why are you running WordPress networking with domain mapping on a shared server?”
Call your shared host provider they should be able to help you navigate the menu’s and change the CNAME or what have you.
I’d suggest getting a “virtual environment” or anything other than a “shared host”. For me all I have to do is set a sym-link (symbolic link) aka “short-cut” to point one folder to the other and I’m done! Super easy 😀
I host with (mt) MediaTemple and have a (ve) account and loving it!
You actually CAN use it on a shared IP address, because that’s how I do it. It requires an extra step, but it works. You have to park the extra domains on top of the wordpress install domain. I do this with WHM, but I’m pretty sure that you can park domains via cpanel also. I’ll have to double check.
So yeah, domain parking on top of your wordpress install’s main domain works.
I got this working on shared hosting as well with a shared IP.
My only issue is that I can get http://www.mydomain.com to work, but if I ever do just mydomain.com it redirects to the main MU domain instead of to http://www.mydomain.com. Any ideas how I can fix this?
Maybe I should have made mydomain.com the domain mapping and then done a cname for http://www.mydomain.com? Anyone else had to deal with this?
what exactly it means to park the extra domains on top of the wordpress install?
is changing IP the trouble, not shared IP?
Zane, thanks for replay. At the moment I can’t afford descent managed VPS. For now I will have separate WP instalations. As far as I can see good managed VPS with cPanel is around $35-40 a month. Maybe I will start earining that money in a year or so. Until then I have three shared hostings that I have with friends and it cost me aboout $100 a year.
I am using a GoDaddy shared hosting platform
I’ve successfully created a network and have added a site. (using sub-domain setup)
I have pointed the A record (host is @) to the IP of my main blog, and removed the original A record
I am getting the following error
Forbidden
You don’t have permission to access / on this server.
Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
I am not sure if I missed a step or I may not fully understand something. Is the shared hosting IP causing an issue?
Thanks for your help
On your GoDaddy hosting account, go to Settings->Domain Management, and add your domain to the list of domains for your hosting account.
I think you need at least the “Deluxe” hosting account to be able to host more than one domain from it.
Regardless, simply changing the A record isn’t enough. The server needs to know that you’re hooking Domain X to account Y, and that area is how you tell it that.
Use the same path as you have in there for your other domain. The idea is that you want the domain to go to the same install of WP, and let WP serve different things for different domains.
Thanks Otto,
I mapped my domain to the same domain as my wordpress installation on top of adding the A record to point to my domain with the wordpress installation. and it seems to be somewhat working. I am guessing the DNS hasn’t fully propagated.
my only question is in regards to my mapped domain, should there be two A records (the original and the one pointing to my wordpress install). Seems to me that would hose things up and I should only have one.
You should have only one A record on the domain.
The error message says it:
Forbidden
You don’t have permission to access / on this server.
In short what is happening is that the WP networking install with domain mapping is trying to access your website from / and your not really there (confusing huh?). I think its an issue with the shared host, are you sure you have access / on your box? since its shared, they (your host) normally has multiple accounts under / all of which are sym-linked and routed else where, so I’d call them.
Sorry 🙁 but its a start.
Otto,
Just curious if this will work on a sub-domain (ie. blogs.leetlink.com) instead of a domain (ex. leetlink.com). If so, how is setup different?
TIA!
WordPress already supports subdomains directly for multisite. So this sort of thing isn’t totally necessary.
However, WP does make you choose between subdirectory and subdomains. With this plugin, you can choose subdirectory then map subdomains, allowing you to do both/either.
Setup is basically identical.
I meant I have the network installed on a sub-domain instead of a domain. Does this make installation any different (so that the URLs will point to the sub-domain instead of the domain)?
Oh. No, not really. Same basic difference there.
As above I want to use sub domains, but I want to map different subdomains to one primary domain. For example.
I have http://www.mysite.co.uk where the blog is, I then have multi site on here. So the URL is http://www.mysite.co.uk/newsite/
but I want the url to be blog.myothersite.co.uk pointing to http://www.mysite.co.uk/newsite/
Is that possible with the plugin? I would assume you could just point the domain record of the subdomain name as you would the normal domain?
DNS finally propagated.
I have two weird issues however…
1) from SuperAdmin, when I go to visit a site, it redirects the main domain but keeps the same sub-directory. For example. The site is set up as http://www.originalblog.com/newblogpath/. When I visit from superadmin, it redirects to http://www.newblogurl.com/newblogpath/ which throws a 404 error. I have no other 301’s in my htaccess. I have the permanent redirect option checked. I tried hard coding a 301 redirect for /newblogpath to http://www.newblogurl.com but that had some other adverse effects.
2) I have www set up to point to the host (@). I can navigate to http://www.newblogurl.com just fine. However if I enter newblogurl.com, it redirects to my original blog url. Because of a shared hosting account, I had to park newblogurl.com on top of originalblog.com. Am I missing something in DNS or htaccess?
Thanks in advance.
Jonathan,
Your second item is my problem as well. If you find a solution please let me know and I’ll definitely do the same.
[…] instructions at different times. Now, I decided to re-do the WDM install, carefully following only the Otto WDM tutorial. […]
after allowing the sunrise on in the config, this is the erorr i get on my website…
No site defined on this host. If you are the owner of this site, please check Debugging a WordPress Network for help.
You’re not giving us enough information to help you.
Did you install the site in the root directory, or did you upload the “wordpress” directory into root?
well i already have the website running, does this mean im not supposed to install the website until i do this first?
You can convert a site to wp w/domain mapping, just keep in mind somethings may break, since you’re doing this on a live site be ready for some down time.
well the problem is i cant configure it it, it is a live site, and i have backed up everything mysql and so, but whenever i change the config file for the sun to be on, site shows that message and is iresponsive until undone…
You still can do it, you just need to follow through with all the steps. You may get an error message if you check out your site halfway through. There’s also more steps besides the sunshine file. If this is a live site I’d suggest that you revamp your work follow, prior to even thinking about WordPress networking with domain mapping and set-up a stage site first.
Dev Production
Great info bro, I used on my wp powered website. Thanks
Please can someone give me a idiots guide to redirecting a domain mountgrace.za.net to my wordpress subdomain http://mountgrace.timeoutbookings.co.za/
I been following Otto’s Tutorial but get confused in Step 4 when it comes to working with the DNS in the CPanel
“you will need to edit its DNS settings to actually point to your server IP or CNAME or whatever you do to make the domain connect to your server.”
I parked the domain mountgrace.za.net on top of the wordpress install domain http://timeoutbookings.co.za/ but get a error
“New domain already exists.”
I’ve had a look at the Simple DNS Zone Editor in the Cpanel, but am not too sure what to fill in, if someone could direct me please..
I’m not too sure how I did it but I seem to have got it working using a CName. The problem I have now is how do I map multiple domains to diff sub-domains on my site as I can only map one it seems..
Antoine:
In the CPanel, you should be directing an A Record for your main domain to the IP address.
For all other domains, use a CNAME record and map them to the main domain. That’s it.
Then, you should go into WordPress and create your additional sites in the network using Super Admin. Once you’ve done that, you can click on Domain Mapping to map your 2nd and 3rd or more domains to their respective mainsite.com/blog2, mainsite.com/blog3, etc…
Hi Otto,
I would like to say thank you very much for you tutorial. I have configured my multi-site successfully (http://www.studyguide.com.vn).
Still, I have troubles change all of the sub-site to be with www. (all of them are non-www, e.g: http://thongtinduhocuc.com, http://thongtinduhocsinh.com) and I know that it is not good for SEO campaign.
Do you know any solution for this issue?
Thank you again.
I’d be interested in this also, as I’ve tried adding the following to my htaccess:
RewriteCond %{HTTP_HOST} !^www\.[a-z-]+\.[a-z]{2,6} [NC]
RewriteCond %{HTTP_HOST} ([a-z-]+\.[a-z]{2,6})$ [NC]
RewriteRule ^/(.*)$ http://%1/$1 [R=301,L]
But I think something with the plugin does not allow this?
I’m trying to make it work but when I write in the browser the url of my website it redirect me to the subdomain of the MU installation ?
Where’s the problem ?
Oh Sorry solved setting the primary domain.
I managed to redirect my domain name to my sub domain but am now having a problem with the editor in the subdomain.
I can’t perform functions like hyperlink, inserting forms, galleries etc via the editor and have to code it in via html. The editor still works fine in the main site but not the subdomain sites
The editor was working fine before I changed the subdomain from mistyhills.timeoutbookings.co.za to mistyhills.za.net
I have tried deactivating the editor plugins but the problem still persists. When I click on a function like hyperlink or insert form in the editor a blank screen appears.
Whats interesting is that the sites I created after I set up the domain mapping are working fine. The sites I created before are giving me problems. Also if I reset the Domain Mapping primary domain back to mistyhills.timeoutbookings.co.za then the editor seems to work.
Any ideas?
Hello Otto et al,
here is a question I have for some time now. I have a blog that is accessible from Internet and from my LAN. From internet it is accessible with a public IP and public domain, and from my LAN it is accessible with a private IP and a private domain.
As a result it is working very bad from the inside — the skin is absent, wp-admin doesn’t function correctly IIRC.
Is the solution suggested in this toppic (using domain mapper) a proper solution for my problem or should I change something in the organization of my IS (something as masquerading all intern connections to the public IP, but it is a nasty hack thought).
Thank in advance
No, domain mapping has nothing to do with your problem.
Why can’t you make the domain resolve to the internal IP when you’re inside the organization? At one of my old companies, “example.com” resolved to 10.x.x.x when in their organization, or the real external, live IP otherwise. This is a simple matter of configuring your DNS server correctly.
Don’t have a DNS server? Use host files inside your LAN to make the domain name resolve to the internal IP.
I do have a DNS server but I prefered having two distinguished domains for my inside and outside networks. It was a choice that I did because it seemed more clean to me this way. Given the fact that I don’t have much experience I was asking myself what would be the “common way” to do this. Indeed I was thinking at one moment to define the same domain with my internal and external IPs.
Do you suggest me that ? Would the plugin permit me to do this ?
The plugin has nothing to do with how you configure your DNS. This plugin will not help you with your problem in any way, shape, or form. Forget the plugin.
Thank you. A guy pointed me to this document http://www.howtoforge.com/two_in_one_dns_bind9_views which seems to be what I was looking for.
kthxbye
I have wordpres 3.0.4 multiblog in a folder named /wp/
I tried to change it to the root folder, but then I have an error because I loose the database connection
Is there not a way to do that without having it direct in root?
It’s really a nightmare…
You can you’ll need to manually adjust your wp-config.php file along with your .htaccess file.
keep in mind that “moving” a site like this may cause more unwanted issues and is outside of the plugin
do you know any tutorial for moving wordpress multiblog?
I only find tutorials to move wordpress without multiblog, and it does not work because the general settings are not the same and I don´t know how to change the wordpress adress…
thanke you, i´m getting crazy with this thema…
you’ll want to edit:
– .htaccess
– wp-config
– log back in
– (pray)
– if you can’t get back in you may have missed something
– edit some db tables that direct to ‘site url’
– try to log in
OR
– do a fresh install of WP
– do a fresh install of WP + Networking
– do a fresh install of WP + Networking + Domain Mapping
– import/export your content
– re-install your themes/plugins
– download a search and replace plugin, if you need to fix image links inside of your post
– download a import /export plugin for “settings”
– done
but really, WHY? that’s the main question
I’m surprised you had any luck at all with the network rooted in a subfolder. I never got that to work at all…
Zane, I think your advice is quite good. Certainly there will be times that a site needs to move to a new server, and the same sort of steps will apply.
My method: When I’ve had to move things around in this fashion, I usually just make the changes to wp-config and the database. The thing that most often gives trouble when you have moved a site is the options table, specifically the site url options. If you go in with phpmyadmin and search the entire database, you will find only a few tables with changes. Export the code for those (be sure to us ‘update’ rather than ‘insert’ option when exporting), edit the sql code to fix up the urls, and import it. This is quite straightforward and it works.
I wonder if people are getting confused when you say “root folder”.
Relative to Unix, I have my folder for godsblogs.com down in
/var/www/http/godsblogs, and that’s fine since that is what I have
DocumentRoot set to for this domain.
And this whole domain mapping thing works awesomely now by the way thanks to those brilliant developers who made it work and wrote up awesome documentation that made this thing so simple from the WordPress site. Still you have to do the work at the DNS server and in the Apache configuration or configuration for whatever web servers you are using. But, I love it. I have a bunch of WordPress sites crammed into one installation, and I have a bunch of Drupal sites crammed into one installation and both running in an APC cache with email and memory left over on a tiny VPS with 256 M of RAM and only 10G disk and have memory left over, and it runs like blazes.
Dan
Yeah, you’re probably right, but I don’t know how to phrase it better. The root of your site? Something like that, perhaps.
It doesn’t help that a lot of webhosts try to hide all the critical information from you and put strange web interfaces on it.
I had hosting on a C-panel setup for a long time, and I worked with it OK, but after awhile it drove me nuts. I needed a VPS with my own Linux setup.
I moved all the crud out of the .htaccess files and into configuration files that start with Apache for both the Drupal and the WordPress sites. I slapped on an APC cache and moved a couple dozen Drupal and WordPress sites over to my VPS. I set up some Perl scripts to watch the logs and firewall out about a thousand badguys, but it’s dynamic to keep from locking out some DHCP based IPs from Comcast and such. I threw on an exim server and dovecot and set up greylisting and authenticated several domains in MySQL. And the whole environment runs rock solid like the blazes in only 256M of memory.
Now that I’m free to take a break from infrastructure/techno-geek work and can work on fun stuff. Well, I have to shape the foundations of the sites better–mostly the Drupal ones. The WP ones are in pretty good shape. And then I need to focus more on content. Or grab my camera and shoot pictures to do some theming. Fun stuff.
But, I’m really loving this domain mapping! It works like a charm. Before this, I had a strong preference for Drupal as I had a ton of flexibility to drive several sites off one installation sharing databases or breaking them out as I wish. With WPMU I cannot really break out sites into separate databases unless I want to create separate insallations, but that takes memory and you cannot share stuff in the APC cache as easily that way. But, I love the feel of the WP setup.
I wonder if anyone cracked how to install wpmu into a subdirectory, or use subdirectories rather than subdomains and get domain mapping to work with that. I’m tempted to set one up on my laptop as an experiment.
I don’t like the idea of doing customizations that might be zapped in an update of WP or of any modules. I have tried cheating just a little–for instance to get a copyright statement to go to the current year, and then I updated a theme and voila, the last date turned into a # sign. Doh… I knew it was going to happen, but I had to do it anyway…oh well, you live and don’t learn sometimes…
[…] So, I undid everything and started from scratch. First I made sure I followed the instructions very carefully laid out on this fabulous tutorial about the domain mapping plugin. […]
[…] Otto has written up a great guide to using the domain mapping plugin. […]
[…] WordPress 3.0: Multisite Domain Mapping Tutorial […]
hi I’m having problem with the domain mapping i believe i installed the plug-in correctly, but could not get it to work..
for example Multisite install is here..
http://www.multisite.com/
and created a site using subdirectory
/anothersite/
then i mapped it to anothersite.com
when i go to http://anothersite.com/
it goes to the Web Server’s Default Page..?
any ideas?
Please help..
Do you have access to the apache server logs? (I’m assuming your on apache and not IIS :D)
[…] am început să le grupez într-o instalare WordPress MU cu subdomenii și, acolo unde este cazul, maparea unor domenii. Problema principală nu este IP-ul dedicat, un upgrade relativ ieftin la majoritatea […]
talk to your host to make them able to point the domain name at your existing site. How to do this varies from host to host, but the important thing is that when you visit your new domain (before you do this!) then you want it to go to your main site, as is.
I’m a bit confused (excuse me being a noob in all the DNS stuff). So first I would want my new domain2.com to point to the same location as my old domain1.com? So that both adresses go to my WP installation in the root of the server/public_html?
Note that if you didn’t get the domain pointed at your server before doing this, then your site will instantly vanish from the realm of mortal man. Setting the primary domain takes effect instantly. You won’t be able to access the site through the old domain any more.
??Then my old site can’t be accessed??
Ok can anyone give me a hand setting up in Media Temple. Cheers Muz!
First, Great, glad to hear that you have a MediaTemple account!
Second, depending on which type of account you have would require different steps to get this working.
* Assumptions, you own the domain name, it is hosted on (mt). Your are NOT adjusting a PRODUCTION SITE!
(ve) — just do the manual install first of WordPress Domain Mapping. Remove the DNS record from the domain name you wish to map to. Make an entry in your httpd.conf/vhost for the mapped domain. Then go into your web-root and sym link your “mapped domain” to the one with the install of WordPress Domain Mapping. (this by far is actually really easy).
(gs) — You can follow most the comments here for adjusting your DNS records. To the best of my knowledge it should be something like: Remove the DNS record for the domain name you want to map to. Go into “domain tools” for the domain name that is the primary and in “edit DNS zone” add the domain you want to have mapped.
Thanks Zane,
I still feel like I’m square one. Details of my set up are below if you can help.
Domain mapping plugin
Server IP Address: 72.47.228.127
Site: 6
Domain: tuckerscycleinn.com
Primary ticked
Domain with Crazy Domains
ns1.crazydomains.com.au 203.170.87.12
ns2.crazydomains.com.au 203.170.87.12
Set as Parked
Hosting with Media Temple
tuckers.bentapple.net
Thanks in advance Muz
I am unsure on how to set up domain mapping, is anyone keen on a paid job to set this up.
Thanks Muz
I think some of the folks who wrote this module or who have already been helping folks with this would deserve a paid job doing this more than me, but if nobody has replied yet, I’ve had pretty good results setting this up on my own site. However, I use subdomains and not subdirectories for my blogs.
If you need some help getting it done quickly, I may be able to help. But, if you’re using subdirectories rather than subdomains, I would probably prefer to spend a little time working through it on a test installation on my laptop before feeling confident to jump in and help someone else out. With subdomains, though, I could probably get you up and running fairly quickly, so you might not need to go to the expense of paying someone to do it if it would only take a few minutes.
Thanks Daniel,
Email me and I’ll send you my admin details. Muz
Hi Muzza, I sent you a note and a friend invite on Facebook as I did not see your email at first glance.
I’m in California which puts us in different time zones and I’ve only installed the Domain Mapping into godsblogs.com which is set up for subdomains. I sent you my email address in the facebook message.
Thanks,
Dan
Actually, danieljdick.com has a “contact me” link at the top which will give you a way to make a first email contact with me without opening either of us to a flurry of spambots.
I should have thought of that earlier.
Dan
Mussa, if I’m reading you correctly, you have an WPMU site at bentapple.net with a blog you set up as blog 6 which is tuckers.bentapple.net, and you can currently browse to that, but you would like to be able to browse to tuckerscycleinn.com instead?
If you already have DNS pointing tuckerscyclein.com to 72.47.228.127
and you’ve copied across the two files–sunshine.php and one other, and if you’ve already set up the sunshine variable in your config file, then you are only about an inch away from solving it.
Log into tuckers.bentapple.net as the site admin. If you look at the top, it’s possible to become a site admin or a network admin. Here, you want to be the site admin.
Then as site admin, go over to the left column and look for Domain Mapping. You should see tuckers.bentapple.net as your current primary site. Enter tuckerscyclein.com and click the checkbox to make it your primary and submit.
Now, what might happen is you may end up with an unknown website if your DNS is not set up to point tuckerscyclein to the right IP address. You can see if that is the problem by editing the host file on your laptop or desktop and seeing if you can browse to your new site. If so, then you know you need to go back and correct the problem in DNS and set up an A record for that domain tied to that IP address.
But, changing it in DNS does not mean you will get an instant change worldwide. It may take an hour or a day or two to propagate your DNS changes everywhere. But, if DNS is already set up properly, you should see your new site at the URL where you want it to reside.
Dan
Muzza, I checked. The DNS entry for tuckerscycleinn.com does not point to anything. You have an entry that you can see using
whois tuckerscycleinn.com and it shows being registered with
AUST DOMAINS INTERNATIONAL PTY LTD DBA AUST DOMAINS, INC.
But, if you do an nslookup on it from my server, you don’t see anything coming back.
I thought it might not have propagated, but when I go to ns1.mediatemple.net, it also does not seem to know that tuckerscycleinn.com exists. You need to set up an “A” record in your DNS for tuckerscycleinn.com pointing it to your IP address.
Dan
I dropped the following entry into my laptop’s
C:\windows\system32\drivers\etc\hosts.txt file
72.47.228.127 tuckerscycleinn.com
And browsed to tuckerscycleinn.com and it did not work. That tells me that you don’t have domain mapping set up correctly yet. That tells me that in addition to setting up the DNS, you need at least one of the following:
1) the sunrise.php file copied into wp-content
2) the file domain_mapping.php copied into mu-plugins
3) the wp-config.php modified to include
define( ‘SUNRISE’, ‘on’ );
4) under site management for the subdomain,
you need to have tuckerscycleinn.com set up as the primary domain. If you set it up as a secondary domain, it will probably still work, but it will redirect you back to the subdomain rather than showing tuckerscycleinn.com in your browser’s URL bar. In fact, you can set http://www.tuckerscycleinn.com as a secondary domain and tuckerscycleinn.com as the primary and set up a canonical for tuckerscycleinn.com so the search engines don’t see it as a duplicate page. Actually, I think it sends a 301 redirect so it probably won’t be a problem anyway as google will see the primary domain as the real one and the other as just a permanent redirect.
Success, but it was not as easy as it normally might be.
Muzza had things set up almost perfectly, but if you have a master site at mediatemple with other sites underneath it, you may have to create the new domain so that the DNS settings are set up and the directory is created for a website to go into for the new site, and then you’ll need to log in using ssh, move that directory aside, and link it to the directory for the website that contains your wordpress-mu site.
It’s not an ideal solution, but it works and if you update anything in the wordpress site, of course the other sites are automatically updated as well from a filesystem standpoint though you may still need to click the button on wordpress to update all the subdomains.
But, it’s working.
Beware of this problem because just creating a DNS “A” record or CNAME record to point the new domain to the main website won’t be enough if Apache does not direct requests to the right directory. Ideally, you’d point your httpd.conf file for your new domain to the same documentroot as the wordpress site. But, in this case, since that is out of reach, you have to improvise.
Dan
whooops!!!!!! No pictures on the resulting domain!!!! Ouch. It may be an .htaccess thing…ouch, ouch, ouch!!! hold off on the “success” 🙂 I cannot believe I missed that totally.
Dan
Muzza, I flipped both domains back to letting the subdomain be the primary, but you can change it by going into the site admin screen and going to tools and going into Domain Mapping for either site. Currently, the actual domain redirects to the subdirectory for now because the pictures show up in the subdirectory but not when the main domain is showing.
So you may want to set them back to the main domain and fix up the pictures making sure they’re in the directory they’re supposed to be in.
Let me know if I can be of more help. The domain mapping seems to be working well now other than that.
Dan
When you switch to another domain, but your pictures are anchored to the subdomain with a fully-qualified URL, those will probably have to be changed in order for people to see them.
It’s a fairly minor problem and easy to fix if you don’t have many pictures or pages in your website. But, if you do, it might mean a touchy SQL update with fear and trembling 🙂
Hello Daniel,
Thanks heaps for helping me with the domain mapping. Sorry for not getting back to you earlier, I have been dealing with a small amount of depression and the decision to close down my business. And yes I was another starving artist trying to make his foot print in this world. I’m sure you have already seen my website, there is some pretty cool adventures and stories to sustain your appetite.
Moving on the missing images will easily be changed with the search and replace plugin. Still I would like to pay you for your grand efforts, please send me an email with your paypal or account details. Thanks again Muzza
Hi Muzza, Just happy to hear from you that the domain mapping is working well and hoping that it will help bring success your way. It was my pleasure to help out, but if you want to send something my way perhaps we can divide it up with WP and Otto if that’s OK with you because they were the ones that made all this possible for us. I’m sorry you have been feeling depressed lately. Me, too, and that has been the case for many IT professionals these last couple of years.
I want to set up a website to help unify IT pros and find ways to put displaced, unemployed, and over 50 folks in a place where we can form a formidable united front and get our displaced workforce back to work, either working for the existing companies or competing with them and beating them very, very, very soundly.
[…] Otto has written up a fantastic guide to using the domain mapping plugin. […]
Ok. This definitely looks like the plugin I want to make work. I can get wordpress mu to work just with 3.0.5. However, when I insert define( ‘SUNRISE’, ‘on’ ); I get “No site defined on this host. If you are the owner of this site, please check Debugging a WordPress Network for help.” Remove the line, works fine.
What am I missing? Obviously my host allows for “wordpress networking” because multisite seems to work fine. Domain is hosted at godaddy.
Beating my head against the wall.
Hi Bruno – there is an order in which you need to turn the SUNRISE file on… check out my post at http://bridog.net/2011/01/wordpress-3-create-network-and-domain-mapping-plugin/ which makes references of this post on Otto’s site, and the beginning steps on wordpress.org
Ok. thanks Brian, that got the plugin working. This is what I want to do:
30 addon domains – all registered with network solutions
All domains have different content but share same template/plugins
1 wordpress install, 1 set of plugins installed
Is this the plugin that I want to use?
I also do not see the “domain mapping” under the super admin options. I am using wpress 3.0.5 — is this something that has been updated? Just not seeing any of those options.
Hi,
I’m hoping someoene can point us in the right direction before I basically tear my hear out (or rewrite the domain_mapping plugin myself)!
We have this setup in subfolder install… I’ll get to that in a minute, let’s call our main installation domain for WordPress maindomain.com…
So when we create a new site in our network WordPress automatically wants it to be maindomain.com/blogs/sitename.
We then use the domain mapping plugin to map this back to be blogs.sitename.com (we’ve parked all the correct domain names and subdomains on top so DNS is all working fine) and get the main site ( we have to edit the options for the site in the network and make sure all the links point to the right place) but it works for the vast majority of the sites we’re working with.
Here’s the problem:
We have: blogs.sitename.com all setup and working and it works nicely. Permalinks set to /%category%/%postname%/
However as we’re in subfolder install of WordPress MS, we actually need a blog called:
blogs.sitename.com/subblog
and
blogs.sitename.com/subblog2 for that matter
Now obviously I can see there’s going to be an issue, how will the /%category%/ permalink be differentiated from subblog ?
I went a did some digging in sunrise.php, and see it uses just the domain name to calculate which mapping to use (not the path or anything after it which in this scenario it needs), I’ve done a little bit of hacking and can get it to identify the correct blog mapping, but then I run into circular reference redirects and allsorts of things.
Am I barking up the wrong tree editing sunrise.php and should what I want to achieve just work anyway with the just the correct options?
To clarify:
I need
blogs.maindomain.com, permalinks /%category%/%postname%/(Primary and working)
blogs.sitename.com, permalinks /%category%/%postname%/(working)
blogs.sitename.com/subblog, permalinks /%category%/%postname%/(Not working takes me to blogs.sitename.com because of sunrise.php)
Anyone?
Hi,
Okay I have installed and have the set up.
http://www.domain.com
http://www.domain.com/website1/
I have mapped the domains. I have also parked website1 domain on top of http://www.domain.com
website1.com resolves a 301 redirect to http://www.domain.com/website1 but how do I get website1.com to resolve and not show http://www.domain.com/website1 URL in the browser bar?
Thanks
Hi,
I am willing to pay for anyone who can help.
Thanks
Carl
Thanks for the update for WP 3.1
Noticed the date on WP is still set to Oct 2010 for last updated, had to double check.
Thanks again Muz
Hey Murray,
I don’t see any update for WP 3.1 in the doc, what do you mean with thanks for the update for 3.1?, will this work for both 3.0.5 and 3.1?
Thanks!
Daniel,
glad you got this working for him! If you look at my most recent comment you’ll see that for mediatemple account holders I point out sym linking aka short cut or “pointing a folder to another folder”, sorry if this wasnt clear.
In the end glad you got it working for him, he’s on media temple, wordpress and using domain mapping!
Thank you for sharing about linking the directories for Mediatemple. It would have been a great help had I seen it earlier, and I should have been keeping up with this group. I’ve been busy working on my own web sites and have only been ducking in here once in awhile just to see what’s happening and hoping to have an opportunity to help out once in awhile. It’s a great plugin and you folks have really done some great work making something that should be complicated as simple as possible.
that and sorry I did not see it. I should have read the whole thing. It’s just that I’ve been busy working on my own web sites and doing job hunting so I only duck in and skim things now and then. But, this plugin and the advice shared here, and the simplicity of it all is really great.
Muzza, Murray? Just wondering if you got my emails or updates.
I haven’t heard back from you as to whether things are working the way you want
it or not, but then I was in e-mail misery for a couple days and may have lost some of it along the way. I changed hosting providers and had most of my stuff moved over to my VPS but not all of it, and I also had a little problem with getting rid of spam.
Let me know how it is working for you. At this time, as I left it, if you set the main domain to be the desired domain, some of the pictures go away. It appears you may have hardwired the URL to go to the subdomain. If you fix that, you should be able to go to the Domain Mapping and point it back to where you want it to go.
Dan
hi guys.. if i wanted to map the same blog to a http://www.domain.com and http://www.domain.com.au how would i set that up using this feature?
Cheers,
Tom
Thanks for a super tutorial — I followed it and managed to successfully install a network and a sub-directory …
My only problem is that when I view the test site I see the test twentyten theme but no CSS for the theme is read or applied
Where did I go wrong? thanks for any pointers
[…] BONUS TOPIC: How to map top level domains in multisite: verysimple.com ottopress.com […]
Hi,
Do we have any way to make domain parking in host automated. I mean that once I have a new domain, I must park it to my host manually. It is so inconvenient to my users.
Thank for your great tutorials.
I’m not sure what you mean by “park”. Is the idea that they get a domain name, say, from Godaddy.com or some other registrar and tell GoDaddy to use your name servers or point their “A” record at their DNS server to the IP address you give them and then they are automatically pointed to a fixed web page that is either shared by everyone or unique to them? Or do you intend for them to have a WordPress site set up for them with basic template information in it?
I’m trying to figure out whether this is more of a DNS question or Apache or some other webserver question or a WordPress question. Is your system a C-panel setup, a VPS, Microsoft, Unix/Linux?
Thanks and sorry to ask qo many questions in return. By the way, my wife is Singaporean and I stopped by there and stayed a few days whenever I went to Jakarta, Indonesia back in the 1990s.
Dan
Hi Daniel Dick,
Thank you very much for your prompt reply.
This is what I meaned: I am setting a wordpress MU and use this tutorial. It’s working well but when my user has a domain, say http://duhocmalaysia.edu.vn, and he wants to replace his subdomain, say http://www.studyguide.com.vn/du-hoc-malaysia/, he must point to my IP addresss, change DNS to my server whereas I must login my CPannel and choose “park a domain” and park http://duhocmalaysia.edu.vn to my host. The subsite will not work without my side step. I am looking any way to make my side step to be automated.
I am sorry If I have confused you because of my English.
Thank you
Hi Du Hoc,
Your English is fine for me. My wife and her family are Singaporean and I’ve attended Indonesian churches for almost half my life.
Please let me see if I understand you correctly and forgive me and be patient if I missed something. If I understand correctly, you have a WordPress-MU installation running with Domain Mapping perfectly on your C-panel setup. Let’s call it
http://www.studyguide.com.vn/
You have a large user community that want to map their own domains or subdomains to your WPMU installation. Let’s call one
http://duhocmalaysia.edu.vn
You can do that but it takes manual steps. Your user has to set up an “A” record in DNS on some DNS server that is the authority for that domain to point http://duhocmalaysia.edu.vn to your IP address, or perhaps use a CNAME.
But now that this is done, you have to take two steps:
1) Log into WordPress and create the blog du-hoc-malaysia for him. And this creates http://www.studyguide.com.vn/du-hoc-malaysia/
2) Create a Domain Mapping entry for http://www.studyguide.com.vn/du-hoc-malaysia/ to set http://duhocmalaysia.edu.vn as the primary domain. Or secondary just to keep it continually available through the process.
3) Log into C-panel and park http://duhocmalaysia.edu.vn onto http://www.studyguide.com.vn
And this works, but is time consuming, and you would like an automated solution to do #3 through C-panel or WHM or the underlying Linux environment? Or is it that you want to combine all three steps into one perhaps so that people can purchase services online and kick off a program that would take care of all three without any involvement from you?
I remember playing around with trying to do something like that a few years ago, and there is a programmatic interface, but I cannot remember whether it was only with a reseller’s type of account. I think it was, and I think it may have been tied to WHM rather than the normal C-panel stuff, but that would be more of a C-panel related question than WordPress. Even so, it may be of general interest to this group.
Are you running this from a reseller’s account or a normal C-panel account? I was going to dump my C-panel account altogether since I was happy after moving my things to a VPS, but it may be useful for me to keep it just for development and testing.
Hi Daniel Dick,
What you are saying is extremely correct!
I am using a sharing host of PSek hosting. Everything has been fine except I knew that my competitors are able to combine all three step you mentioned into one only. The automated process kick me off the race.
I know that they are the host related features and they code some commands for the host to recognize and map the pointed domains automatically.
Your answer is highly appreciated.
Thank you very much again,
Hello,
I’m wondering if I could get your help and guidance with the wordpress multisite. I backed up the entire site locally then proceeded with the upgrade. I then installed the domain mapping plugin not directly using the site but exactly how it is recommended on several forums. There is something that keeps going wrong. And frankly after 5 days of installing, uninstalling, then reinstalling – I’m tired and more confused then I was when I started this process.
Here is what I would like to know, if I provide you with ftp access and create a new database could please help me to get this setup correctly. I would greatly appreciate your help and direction. Alternatively, if you don’t have the time or want to help, is there someone you can recommend who can take care of this for me? I don’t mind paying to have this done as long as I can afford it :).
I am really, really in need of help. Thanks, Nayeem – 951-200-4121. I’m located in California. You can call me anytime. Again, thanks for taking the time to understand my situation.
Sorry we got disconnected yesterday and didn’t get a chance to connect again. I looked into the white screen thing. Common causes given were plugins and themes gone awry and common solution was to rule them out one by one. But, you had no themes or plugins yet at least on one of your environments. But, one person mentioned that having the domain_mapping.php file in both the plugin and the mu-plugin directory would white screen your site. So I thought we might want to check that next. Some mentioned memory shortfall but the errors I experienced when that happened were more descriptive–the website would tell you it ran out of memory.
I’ll try calling again, but I wanted to make sure to leave this with you in case we don’t connect quickly enough so that you could have one more thing to try.
I’m glad to help people out with these domain mapping setups if I can.
As for payment, I know money is tight today and we’re all struggling some,
and my whole purpose in coming here was to get help and receive help during
the time I was setting up my own site. So, whatever I do, I want to be
respectful and appreciative of those who created this plugin, who provided
the documentation. So, if you like, I can just do it for a donation to this
website or to WordPress or to me to do my websites or any combination of the
three as you see fit. Would that be OK?