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.

Domain mapping php file location

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.

Sunrise php file location

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.

Domain mapping setup screen

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.

User Domain Mapping Screen

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:

Sites 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.

Shortlink:

1,194 Comments

  1. Hi,

    Everything was going great. I upgraded WP and had to redo domain mapping. At the end I thought I would redo the primary domain and everything broke. Now I get this on login:

    Notice: Undefined property: stdClass::$site_id in /usr/www/users/wp-content/sunrise.php on line 26

    Notice: Undefined property: stdClass::$site_id in /usr/www/users/wp-content/sunrise.php on line 30

    Notice: Trying to get property of non-object in /usr/www/users/wp-content/sunrise.php on line 31

    Notice: Trying to get property of non-object in /usr/www/users/wp-content/sunrise.php on line 31

    Notice: Undefined property: stdClass::$blog_id in /usr/www/users/wp-includes/ms-settings.php on line 129

    Notice: Undefined property: stdClass::$site_id in /usr/www/users/wp-includes/ms-settings.php on line 129

    Notice: Undefined property: stdClass::$blog_id in /usr/www/users/wp-includes/functions.php on line 3956

    Notice: Undefined property: stdClass::$path in /usr/www/users/wp-includes/ms-default-constants.php on line 44

    Notice: Undefined property: stdClass::$path in /usr/www/users/wp-includes/ms-default-constants.php on line 50

    I’ve been scouting around in various files and folders but don’t know what I am looking for…

    Thanks!

    Andree

  2. Thanks! I can’t see anything but those lines when I log into WP (and they are showing up in all the blogs).

    I redid the mapping as the mapping disappeared when I upgraded….

    Andree

  3. […] network counterpart. This can be a tricky issue, and requires a guide on its own. Here is a great guide on installation. Once you have this install your site should now be running on the new network! We’re not done […]

  4. […] network counterpart. This can be a tricky issue, and requires a guide on its own. Here is a great guide on installation. Once you have this install your site should now be running on the new network! We’re not done […]

  5. Does this plugin work with the new wordpress 3.2 ?

  6. […] network counterpart. This can be a tricky issue, and requires a guide on its own. Here is a great guide on installation. Once you have this install your site should now be running on the new network! We’re not done […]

  7. Hey Otto, I followed these steps and it works great except I can still access the site from the subdomain as well as the mapped domain. Shouldn’t it be redirecting, I have permanent redirection checked off in my settings. Not sure if this is just a problem with the new version of the plugin or something I did, any clues for me?

    thanks for the treat tutorial

    brent
    @
    mimoYmima.com

  8. figured it out, I’m going to post here to maybe save others countless hours of time… So if you’re a newbie to the network setup you might not understand what it means to ‘network activate a plugin’ when I went through that part of the tutorial I just activated the plugin on my main site’s plugins page (since it was there) and moved on. Instead of doing that you MUST active it for the network by going into the super admin area and then plugins…

    brent
    @
    mimoYmima.com

  9. I followed your instructions and got to step 3 and went back in to log into my admin panel for wordpress and get this on the screen:

    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.

    any suggestions?

  10. Holy Shmoly! Many thanks Otto. If your web server is Nginx, you will also need to add a virtual host and symlink for the domain you are mapping; did so by copying the main site’s virtual host and only changing the ‘server name’ to the mapped domain while keeping all the other bits intact. Restarted nginx and was good to go.

    Cheers

  11. […] does a wonderful job explaining how to map domains for your site […]

  12. Which are the settings for the DNS Records of Domain?

  13. Is it possible that I can setup a blog network by Domain Mapping and all blogs can still has it’s own dedciated class c IP?

  14. OK, I’m reading through the comments and the instructions and one minute I think it might work for what I want, and then I read another and I think it may not, so I figured I might as well just ask.

    I’m trying to work out how I can link 5 domains all running WordPress on individual installations, and get the users to login via one domain mainly so I could use one Simple:Press Forum installation across the 5 sites?

    It’s quite possible that this only makes sense to me, so would be happy to explain more if needed before someone could give me an answer.

    I want to use the forum to be able to let people discuss things across the sites, but only have to register once to do so.

    The WordPress part is less important to me because some posts are for the single site only, and some for all sites.

    Perhaps my mistake is the 5 domains and 5 installs, and I should have started with a single WP install and then point the domains at sub sections of the posts. It’s not too late to stop and back track.

    Can you tell I am confused?

  15. I’ve only been using the MU installation of WordPress for about three months, so their is likely someone with more experience that may have a solution for you.

    However I say (based on my MU Installation) that you are right, there should only be one installation of WordPress (3.x or better) and you use the WordPress MU Domain Mapping plugin to map multiple blogs (hosted on your single Worpress installation) to multiple domains as you like.

  16. Hi, I am having trouble figuring this out. The multisite wordpress installation is in a subdomain ( ie: sub.domain.com) , and the child blogs of that network are in the subdirectories (sub.domain.com/subdirectory) Is there something I should be doing differently?

  17. Fantastic tutorial. One question though– should I map a naked domain every time I map a regular domain? Example: http://www.mydomain.com vs. mydomain.com

  18. I am getting stuck in a redirect loop when I load my second domain.

    Thoughts?

  19. Muy buen tutorial esta muy bien hecho y explica todo a la perfeccion….

  20. Great tutorial!! I don’t seem to get the last step to work. My WordPress MultiSite is on Hostgator and the domain I’d like one sub-domain of the MultiSite map to is on Bluehost. So now I added the A Record on the domain on Bluehost and then setup the mapping on the sub-domain. It seemed to work, but it show the content of the site on Bluehost not the actual new sub-domain. I don’t know what I did wrong, but I hope you can point me into the right direction.

    Thanks!!

  21. Hi, followed the instructions.. seemed to go ok!

    However, when I add the domains to be mapped, they display as https, and redirect to https ones.. If I try to go to the http url, it doesnt work… I have used the force admin over ssl code to secure my admin pages.

    More info here:
    http://wordpress.org/support/topic/plugin-wordpress-mu-domain-mapping-mapped-domain-redirect-to-https?replies=1

    Any suggesitons?

  22. […] network counterpart. This can be a tricky issue, and requires a guide on its own. Here is a great guide on installation. Once you have this install your site should now be running on the new network! We’re not done […]

  23. […] WordPress Multisite gives you 3 choices of how to differentiate your multiple websites: subdomain, subdirectory, or domain mapping. For simplicity, I chose to go with the subdirectory option because it uses the ISAPI rewrite filter that we have already installed, and it requires no further installations. NOTE: If you have to go with the subdirectory option, it involves wildcard directories, and you can click here to read about how to set up wildcard subdomains for WordPress. If you have to go with the domain mapping option, you can click here to read about how to set up domain mapping in WordPress. […]

  24. Awesome plugin ,this is exactly what I want, Thank you for it much.

  25. […] configuración de WordPress Mu Domain Mapping es muy sencilla, y hemos encontrado una Guía Completa, (aunque está en inglés), esta guía es muy fácil de entender, y trabaja siempre con Control […]

  26. […] It requires manual installation as one file must be copied to wp-content/. When upgrading the plugin, remember to update domain_mapping.php and sunrise.php. Full instructions are on the Installation page and are quite easy to follow. You should also read this page too. […]

  27. Hi,

    I want to migrate multisite (sub-domain) using domain mapping pluaing to another server. There can be a problem that I posted here. http://wordpress.stackexchange.com/questions/28492/migrating-wordpress-multisite-and-domain-mapping-plugin

  28. Haven’t got this working yet, perhaps because the Aname change has not propagated yet? Anyway, do I understand correctly that this method does NOT require a parked domain to be set? Thanks.

    • Having the same problem as @StillTrying – though I am certain it has nothing to do with the change not propagating. But, from what I can read here on the WP codex point #11 and under the Possible Problems section it appears to be that I have to PARK my domains to make this work?? This would be a major pain as those domains are associated with a lot of email accounts and forwarders…

      What basically is happening to me is that I followed the steps but it appears to trigger a simple redirect – i.e. subdomain.wpmu-domain.com goes to other.domain.com but it does not remap the wordpress site.

      Any pointer very much appreciated.

      • Not “park” and I really wish people would stop referring to it like that.

        You don’t have to “park” the site. What you have to do is to make your webserver point the Virtual Host for that site to the correct location.

        Unfortunately, “parking” is the easiest way to do this on some hosts.

        Basically, there’s two steps:

        1. Point the DNS for the domain to the right place.
        2. Make the webserver know that for requests for that domain, it should look in the right directory for the website’s files (in this case, your WP install).

        Step 1 is pretty universally easy, it’s just DNS stuff.

        Step 2 varies depending on who your webhost is. What you need to do is to talk to your webhost and ask them “How do I make my example.com domain connect to my WP installation?” Specifically mention “Virtual Host” if necessary.

        • I DO understand the difference between parking and pointing. The WP CODEX itself is talking about PARKING (see above link).

          I followed the directions:

          0) created a wildcard subdomain option
          1) set up WPMU and created the new blog as a subdomain
          2) added the domain remapping plugin
          3) configured the master.domain mapping (tried both, via IP number and CNAME)
          4) in the other.domain I added a CNAME record pointing at the CNAME from 3)
          5) set the subdomain to point to the other.domain as the primary blog

          no go.

          My server has IP XXX – all domains are located on the same server and have the same IP number – for this reason I used the CNAME under 3) to ensure it’s pointing to the correct location.

          if I go to the other.domain it does not show the WP blog.
          if I enter the subdomain URL it REDIRECTS to the other.domain but it does not REMAP

          what am I doing wrong?

          • Yes, I know, but that’s not the difference I was referring to.

            “Parking”, in many webhosts, means to put it on a temporary “this domain is parked” page. That’s not the right way, really, although it works often.

            Everything you’re talking about is DNS related, and you’re correct in all of it. However, the DNS is only one half of the equation.

            There’s two things that happen when you visit a website which matter here.

            1. Your browser looks up the IP address of the domain and sends an HTTP request to it.
            2. The webserver on the other end of the domain looks at the request, references it against its configuration, and then serves up the right files.

            You got step 1. You’re done there. Stop fiddling with DNS.

            What you’re missing is step 2. You need a way to tell the webserver that files for example.com live in /home/username/whatever/wordpress (for example). This is done through Virtual Host configuration on the webserver.

            To give an example, on GoDaddy, I’d go into my hosting account, find the domains bit, and tell it that ottopress.com connects to /home/users/o/otto/public_html (not real info). In the same area, it also says that ottodestruct.com lives in /home/users/o/otto/public_html. Both domains point to the exact same WordPress install.

            That’s the bit you’re missing. You need to somehow tell your webhost that both domains point to the same installation, the same *directory* on the web server. That way, when it gets the HTTP request, it knows “oh, this domain comes from here” and it can run the PHP and return the website. The Domain Mapping plugin takes care of it after that, when the PHP runs.

            Now, if you can visit the other.domain and it doesn’t serve the WP blog, then that’s your underlying problem. Your webserver is serving something else for that domain instead of going to the WP directory. That’s the bit you need to solve. This has nothing to do with DNS. It has everything to do with configuring your webhost to serve the proper files for the given domain.

            • Virtual Host config – yes, this is exactly the issue! Thanks for detailing, penny has dropped. And we can edit the Virtual Host config file.

              And, this opens a whole slew of ramifications and this situation also reveals that in my situation there will be unfortunately a few sites which I can not put under this umbrella as in some cases I can not remap a full domain but would like to affect only a sub-directory from within public_html. I am talking about those sites which have their blog at e.g. mydomain.com/blog (visibly, non-modified via .htaccess) – these domains have other things going on directly under mydomain.com and can not “lose” the public_html directory. (I have never heard that Virtual Host config can be set for only a sub-directory, but I might be wrong here).

              I definitely had originally some twisted ideas of how this whole thing flows and is setup and which domain rules what – but I think I have it now all figured out. Thanks!

  29. Is the mu plugin well suited with WordPress version 3.1?

  30. Thanks alot for your tutorial. I´m using WP 3.2.1 (german version).
    I was able to complete step 3.
    Unfortunately I only got till Step 4 “Mapping the Domain”
    I don´t see “Domain Mapping” under tools in the normal Admin-section as you show it in your screen shot.
    I only found “Domain Mapping” under the Network-Admin panel and that allows me to enter the Server IP-Address which I did already.

    Please help! 🙂

    • Turn on the “User domain mapping page” option in the Network Admin’s Settings page. Then you’ll see that option on each individual site.

      • That´s what I call a fast reply. And it´s 2:57am on your side!
        I did turn on the “User domain mapping page” already before. The problem is still there 🙁

        • Well, I dunno then. Did you *save* that setting?

          The “User domain mapping page” option does pretty much exactly what it says. It gives a user-accessible domain mapping page, under the normal site-admin Tools menu instead of only having the mapping accessible under the Network Admin menu.

          I have this menu on my site, right now. And the only options I have turned on are that one and “Permanent Redirect”.

          You can still map domains using the Network Admin->Settings->Domains screen, but it’s not as easy to do, and your individual site admins (if you have them) can’t map their own domains because they can’t access that screen.

          The Tools->Domain Mapping will be on the individual sites, but it won’t be on the Network Admin, nor will it be on the “main” site, since the main site can’t be remapped, only sub-sites can be remapped.

          • Yes, I did save the settings.
            Maybe this is the root of my problem: I have only installed wordpress once on the server of my webhost. (I hope it´s not necessary to have my own server for this). So I only have one installation with one wp_cofig.php etc. I have not changed the tableprefix. Now I tried to change it and couldn´t access the domain nor the the login.php anymore. Changed it back and was able to enter the site again.
            Do I have to change the tableprefix in order to use this function? Do I have to make extra wp_config.php files or even seperate installations of WP to be able to use multible domains under one MySQL databank?

            • No, domain mapping is for use on a Network Installation. This is one install of WP running multiple sites. One wp-config.php file.

              I don’t understand why you’re trying to change the table prefix. That has nothing to do with it.

              Do you have a Network Admin page or don’t you? If you do, then that’s all you need. Domain Mapping happens entirely within WP, it doesn’t need config file changes.

            • I just started following this as well. As Otto said, there is NO reason to change your table prefix in WP config.

              When multisite is true, it will auto-create new tables in the database for each new site instance.

              You will see something like:

              wp-options (for site 1)
              wp-2-options (for site 2)
              wp-3-options (for site 3)

              All other WP tables will be renamed accordingly, with site 1 remaining as wp_(table name), and that’s it.

              The only reason you would ever rename your wp_ prefix is if you are using a plug-in like WP Security Scan to modify your wp_ prefix to something like wp_r8tx9z5_, so that it makes it harder for nefarious criminals to hack your WordPress site.

              You should always rename your table prefix on install or use WP Security Scan to change it, but that has NOTHING to do with multi site.

              Many people on “shared” hosting accounts do not realize that you have to create a symlink by using SSH, and then deleting the folder for the additional domains you registered with your host.

              For example, if you’ve got 3 domains at your host, you may have set them up as:

              domainname1.com
              domainname2.com
              domainname3.com

              If your folder structure in your FTP is

              httpdocs:
              – domainname1
              – domainname2
              – domainname3

              Multisite will not work.

              You have to create a symlink between to the first domain.

              httpdocs
              – domainname1
              —domainname2 (points up to domainname1)
              —domainname3 (points up to domainname1)

              Basically, you are “targeting” the second and third domains to use the DNS of the first domain, which subsequently uses domain mapping plugin to manage the traffic to domainname2 and domainname3.

              Here is a tutorial on MediaTemple about how to symlink your domains.

              http://kb.mediatemple.net/questions/63/Creating+symlinks+to+redirect+your+site

              This works on MediaTemple. Your host may have different instructions, but it’s good to see what symlink does, just from the example, so you understand it.

              The reason we register all of our domains at the host, is so that we can set up email with each domain and keep them separate from each other. By symlinking, you are simply targeting or referencing the first domain as the parent domain with the master DNS, which will then resolve the symlinked domains.

              Hopefully that helps you.

              • Hi Tony!
                Thanks alot! I guess this will help and I will work on it tomorrow again when I´m back at work.

                • FINALLY! I went through the whole process from the beginning again and again. I think my missunderstanding was that I never logged-out and logged into the subfolder url mydomain.com/subblog/wp-login.php to see the domain mapping menu under tools. I always logged into mydomain.com/wp-login.php and tried to do things under Network-Admin, which didn´t work. I can now start setting up my websites. Thanks so much for your support!

  31. Well this happens when a noob gets frustrated. I just tried to find out if this is a possible reason.
    I do have a Network Admin page. On the right top I can choose to be a simple “Admin” or “Networkadministrator”.
    Okay, I would be happy if you have another clue for me. Otherwise I will just start again from 0 and start with the WP installation.

  32. I am unable to get custom structure permalinks ie /%postname%/ to function: Apache returns a Not Found page. Default /?p=123 function correctly. My setup is a self-hosted centos 6 server with wp 3.2.1, wp mu network setup for subdirectory, sunrise and domain-mapping installed and configured correctly, and the .htaccess file copied as wp requested.

  33. Please disregard my last comment/question/issue. Solved it by correcting vhost config for the apache root directory.

  34. I think I have everything set up correctly, but I’m wondering if there’s a way to keep a domain name listed in the address bar, even though it’s redirecting to another one. For example, if I have site1.com as my main multi-site domain, and I have another site, site2.com with that domain pointing to site1.com. When, I enter site2.com in the address bar, the site directs to the right place, but it shows the original domain as site1.com/site2 because I have it set up as a folder. Is there any way I can get it to show site2.com in the address bar, or am I always stuck with site1.com/site2? Does that make sense?

  35. […] network, as well as the installation instructions for the WPMU Domain Mapping plugin, plus an additional set of instructions for […]

  36. Hey Otto:

    I noticed something on another MU installation I’m running.

    My login URL is tonyzeoli.com/wp-admin, but when I access the site backend, it switches to the primary site URL, netmix.co/tonyzeoli/wp-admin.

    It doesn’t do this on another MU install I’m running for reesenews.org. The admin URL stays the same.

    Any way to change this?

  37. I have just started playing with domain mapping. I have 2 domains. Both of them are hosted on my dedicated whm/cpanel setup server. I am using sub-folder installation.

    So the MS domain is site1.com with another blog on site1.com/site2-blog

    site2.com is already pointing to the same ip address as another cpanel account. So where do I add the dns settings to point site2 to site1.com/site2-blog?

    Right now it just opens the default public_html folder contents page from its own account.

    • Can I get any help over here. Does the multisite with multi-domain will only work if new domains are just registered and being parked or pointed to the multisite root server through cname/ip?

      What if the the domains are all on a single server (same ip) already with their own cpanel accounts. We can not park an already hosted domain on the root domain and adding a A record with server ip is already there and adding a cname gives an error. Please help. Do I first need to suspend/terminate the other domains from same ip/server?

      • If you are on shared hosting, you have to “sym-link” your additional site folders to point to the main folder. This is not a domain-mapping plugin issue. It’s the way shared hosts are set up.

        Let’s say you have a folder:

        -httpdocs
        –folder-site1
        –folder-site2
        –folder-site3

        It should look like this:

        -httpdocs
        –folder-site1
        –symlink-site2 to folder-site1
        –symlink-site3 to folder-site1

        Because it’s site has it’s own folder, the DNS registry on the server points to that specific folder only. So, if you’re directing you domain to the IP address, it hits the server and the servers DNS targets the folder instance for that domain name. Since you want a multi-site install, you need to then trick the server into pointing UP to the directory that will act as the root for all your domains on your shared account.

        It’s basically just sending a pass this folder and find me in that folder message to the DNS system at the host. You’re saying, “don’t use me as the main folder for this domain, create a symbolic link that passes through me and targets the domain folder that hosts my multisite install.

        On VPS, you don’t have to do this. It’s just on shared hosting, because of the way shared hosting works.

        I’m pretty confident that’s right. Here’s a tutorial for MediaTemple’s Grid Service: http://www.rogerstringer.com/2011/wordpress-using-multisite-domain-mapping-on-a-mediatemple-grid-server/

        You should know how to access your server via SSH to create the symlinks. It’s very easy to do.

        • Thanks Tony for your reply. I am on a dedicated server and have around 25 sites (with their cpanel accounts) on it. Among them there are 5 sites which are running wordpress and I wanted to consolidate them to a single multisite.

          Multisite is setup on a new domain with sub-folder installation. All the data has been imported to the sub-folder sites from main sites. I have taken all the steps but the domain still points to the existing accounts and I can not create A/Cname record the way it is described.

          If I change the ip of the multisite install would that work? I mean probably then it will let me create the A record with new ip address. right?

          • Okay, let me think through this with you.

            If you have NEWSITE.com set up on the same server as all 25 OLDSITE.com’s, and you are working on a “shared” account, this will only work if you “symlink” the 25 OLDSITE.com’s to the NEWSITE.com URL. That means, you’ll be deleting each site’s director from the FTP folder, and setting up a symbolic link (‘symlink”) so that the DNS redirects the request for each domain to the main NEWSITE.com in the multi-site network.

            If you are on one host and cannot, for some reason, delete all the other domain directors, because those sites are live domains, them my suggestion is to move to another web host, so that you can register the new domain names in that hosts DNS server, without affecting all your live sites.

            Every host has it’s own DNS server. When you set up your hosting account, the hosting companies DNS server then talks to the worldwide DNS registry to tell the registry they are set up to host the specific domain you’ve told them you own and you want a website at that address. It’s not until you tell your domain name management company what IP address your hosting company owns, that anyone is able to type your domain name and have it point to the host and resolve the site.

            That being said, It’s only AFTER you point the A record to the IP address and the CNAME to the root domain at your domain name manager, that your old sites on the host will no longer be accessible when you type the domain name in the URL bar in a browser.

            I’m not sure if all your sites are generating traffic now. If so and you still want to set up an MU instance. You should make the main site on the shared host the primary site, then start adding your new sites and importing them WITHOUT mapping the domains. Only when you have your entire network set up as:

            rootsite.com
            rootsite.com/additionalsite

            and they are all working, should you then start deleting your old sites in their respective folders in the top level of your hosting account:

            httpdocs
            -site1_folder
            -site2_folder
            -site3_folder

            so that it looks like this

            httpdocs:
            -site1_folder
            -symlink1_of_second_domain_to_site1_folder
            -symlink2_of_second_domain_to_site1_folder
            -symlink3_of_second_domain_to_site1_folder

            Does this all make sense to you?

  38. Hi!
    Thanks for the great post but how i understand it, if i manage several blogs on differend domains on different servers this will not work?
    Sorry, i am not very skilled with server things…

  39. Can you tell me if, by activating multisites, my primary domain name site will end up with altered url permalinks? I want to use multisite but before I begin to activate and setu it up, I need to know if my present url structure http://www.example.com/my-current-permalink/reference/ will change in anyway. Thanks.

    • Normal posts on the “root” domain in a multisite setup gets /blog/ prepended to it’s single post URLs.

      So if your root site is example.com, then its posts will look like http://example.com/blog/whatever/.

      The “sub” sites don’t get this unless they want it. But the root has to have a distinguishing mark.

      • Well, first of all thank you for responding. I have posted this question on the WP forums for 2 days with no takers. It’s good to finally get feedback from someone that has been down this path.

        With that said, that was not the answer I wanted to hear, but is the one I feared I would hear.

        Here is what I am trying to do and maybe you can give me direction.

        I manage an exiting and mature WP site. My client wishes to create a 2nd mirror site under a different domain name that will ultimately syndicate or share 90% of the posts from the “main” mature site, in addition to all new posts going forward.

        I will create a slightly different theme and layout for the new site, but I am experienced with that task so no concern there.

        I would rather not install WP again for the 2nd site and do some behind the scenes DB replication. I am hoping WP 3.0+ (Multisite) can do this for me nicely.

        My biggest concern, before I push any buttons to move down the “Create a Network” path or install this MU Domain Mapping plugin, is that I cannot lose the existing URL structure in the current and mature PW site. Too much work has been done in SEO and too many external sites have link backs that the URL simply cannot change.

        Do you have any advice or direction you can point me in?

        Thanks @Otto

        • Well, you can use the Redirection plugin for WordPress to redirect all your current posts to their new, respective URL’s, so that shouldn’t be an issue. It can take 30 to 60 days for Google to dump the current site map and remap your site with the new URLs. You should have XML Sitemaps installed for WP multisite, and you should be registered with Google Webmaster Tools. If you do this, then you should be fine migrating your link juice from Old Site to New Site.

          Second, you NEVER want to have duplicate posts on Old Site and New Site. That is the kiss of death in SEO. If you want your rank to affected, it’s doing exactly that. That is NEVER EVER recommended, as far as I know.

          Third, if you want to pull posts from Old Site to New Site, you simply export from Old Site and import to New Site. No database configuration changes required. If you’ve never exported and imported into WP, try it that way.

          Or, you can use FEED WORDPRESS plug, to generated a feed from your Old Site and publish that feed into your new site via XML-RPC.

          Only the first is a domain mapping issue, so you’re going to have to use Redirection plug-in or you’re going to have to hand code rewire rules for redirection in your .htaccess file.

          Domain Mapping plugin isn’t supposed to care what you do for your SEO. It’s only so that we can map domains and subdomains in a WordPress network install. If it cared about your SEO, then it would be called the Domain Mapping SEO plugin, but it’s not.

          What you attempt to do to keep your link juice is a bigger issue than the domain mapping plugin attempts to solve. Well, I shouldn’t say bigger, I should say completely different, which is why there are tools like Redirection to help with that.

          • Well this changes the scope of the project altogether.

            • So, I just checked both my MU instances.

              Where I see “/blog” is the Permalinks page, however, you do not see “/blog” in the URL. Somehow, “/blog” is hidden from the link structure, and I’m not sure why that is or how it affects SEO.

              It seems that when I type visit one of my sites, http://www.reesefelts.org/reese-felts/, that is the primary domain in the network, but “/blog” does not appear in the URL. If I add “/blog/reese-felts”, it redirects to just “/reesefelts.”

              I can’t say for certain that Google will have some problem with “/blog” when the redirect is automated to a post that leaves it out.

              That’s beyond my paygrade.

          • Tony, I have a question then since you bring to light a very interesting point that I was not truly aware of.

            Let’s say Global News Service XYZ posts a press release from Company ABC and that same press release is replicated, verbatim (you know, content only) on the web site of Company ABC. Then how does Google treat both the News Service XYZ’s site and Company ABC’s site?

            Are they both penalized? Both boosted because there are external reciprocating links? Or is there no impact?

            • I’m not an expert, but I have heard that the primary site that lists the post first and gets into search first is most likely the authority on the subject, but if that site has been penalized in the past for just republishing content, then they’ll fall in the rankings and someone else will gain. For example, if I’m Yahoo! Finance and I post press releases against all the other data I’m aggregating and publishing about a certain company, then that’s a collection of content that is most likely valued as authoritative above a company that simply posts press releases just to get SEO traffic. Being authoritative is healthy to search, copying and publishing across multiple domains is not. You will get found out and you will get penalized. Everyone who tries to do this thinks they can one up Google/Bing and the others. But, search engines certainly factor in who is trying to game the system. This goes to Google pushing down the rankings for all these How To sites who offer no real solutions, just some generic information they are republishing at a massive scale to boost SEO. I always say, be real or go home. Being real is not copying others and republishing. If you want to aggregate using Feed WordPress, then you republish those links off to other sites, while updating the excerpt in your own words, that’s better than simply copying a press release and linking to the company. Google wants you to increase the value of Google, by giving Google relevant and authoritative information on a subject. Once you try to game the system and get caught, your URL is on the blacklist and you’re just about done in search. See SearchEngineWatch.com for more info on these and other SEO best practices.

              • Thank you for the excellent advice and for taking timeout to stick with me on this thread. The matter is important to me on this project (not to mention gaining some new learning) so I am very glad to have found out what I did now rather than trying to understand later why my site fell off the Google (et al) map.

                • No problem. If a client tells you that they want two sites publishing the same content, then they have zero understanding of how Google works. That is “black hat” SEO and it’s the most common gimmick that people use to try and game the system. That was so 2005. It’s the worst thing you can do. The best SEO is when you’ve got a solid site structure, the best and most authoritative content, and you’re connected to Google by xml sitemap and google Webmaster tools, as well as bing’s webmaster tools. There should be no reason to duplicate sites to boost rankings. That is a phallacy and is untrue. I mean, think about it? How can you boost the ranking of one URL, if the same content lives on another? They are then fighting against each other, not helping each other. Okay, so if the goal is to be both 1 and 2 in search, or 2 and 3? It’s just not going to happen, because Google is gong to look at 2 and 3 and compare them. If they are exactly the same under two URL’s, then there is an obvious conflict. It’s almost common sense. I’d fire that client, is what I’d do, lol. Glad to help.

        • Oh, and if you’re really afraid of all of this, then set up “dev.yourdomain.com” and run a separate MU instance with domain mapping, so that you can see how it responds to your needs, without messing up your production server. And, always back up your original stuff, before you attempt to change it, so you’ll be able to roll back if you don’t like the end result.

          I would never attempt to transform my production site into a multi-site, without testing the variables on a dev site first.

  40. Hi Otto,

    I want to thank you first for offering such great support to the WP community. I am in the process of setting up multisite and domain mapping for my company. I got to step 2 of enabling multisite and stopped, because I was given the following message:

    We recommend you change your siteurl to mysite.com before enabling the network feature. It will still be possible to visit your site using the www prefix with an address like http://www.mysite.com but any links will not have the www prefix.

    I have planned to install the WordPress MU Domain Mapping plugin, so I want to make sure I make the right changes to my WP going forward. Do I need to remove the www from the siteurl in WP settings, or will the WordPress MU Domain Mapping plugin take care of this and I ignore this warning. I only have one site to add to my multisite install that will be for a country based domain, so I’ll wnat that domain to be accessible at both non-www and www URLs.

    I read this in the WP forum. Is this correct to do if using the MU Domain Mapping plugin?
    – Go to Super Admin > Options and remove ‘www’ from the banned names.
    – Go to Super Admin > Domains and fill in the main blog-id in Site ID and ‘www.yourdomain.com’ in Domain.

    Your insight and help is greatly appreciated.

  41. hi mate!
    great work here, i’m going mad 😀

    can you please help me? i can’t understand…
    situation:
    wpmu last version
    your plugin
    a sub site: http://www.example.com/site1/

    i used .tk dns free service to map blabla.tk -> http://www.example.com/site1/
    in the domain mapping admin page,
    if i select blabla.tk as primary, the browser goes in loop
    the only way to open site is to select as primary domain: http://www.example.com/site1/

    how can i stop the loop using the right primary domain blabla.tk?

  42. […] WordPress MU Domain Mapping plugin. WordPress developer Sam “Otto” Wood covers it in an excellent tutorial. Again, you’ll need to set up the hosting options for your subdomain and external domain […]

  43. Great plugin. Thanks
    One question is there anyway to make a Search Sites work to find the mapped domain if you are using the Search Sites in the Network admin. Currently it calls the URL /wp-admin/network/sites.php?s=mydomainname.com&action=blogs

    but this will not return anything since the sites.php does not search the domain_mapping table

  44. Does it require a Dedicated server to run Multisite WordPress.

    And the plugin is available to download for auto installation.

  45. Also I am having a website – http://www.wwwlabz.com/ and want to have multi site what change does it require in existing sites.

    Please suggest.

    Any help will be appreciated.

  46. Hello

    I have created blogs for each country of where I have my online store, using one unique main installation of wordpress and then mapping my country domains.

    So my blogs are:
    blog.countrydomain1.de
    blog.countrydomain2.es
    blog.countrydomain3.com.br

    Could you let me know where is my SEO juice “going” with such configuration?
    Ideally I wanted each blog to contribute to the SEO efforts of each country domain. But not sure if this is happening or not.

  47. Hey Carla:

    You need to use a Google XML sitemap plugin that works with multi-site networks, like this one: http://wordpress.org/extend/plugins/bwp-google-xml-sitemaps/

    It will give you you a separate site map for each URL, then you’ll have to register them with Google Webmaster Tools, so Google knows the sitemap URL to crawl for each site in the network.

  48. Quick note on the “Redirect administration pages to blog’s original domain” setting: I suspect that this may have the effect of trampling some wp-admin/wp-ajax.php calls for some plugins, because of the 302 redirect. At least that is what appears to happen in the Shopp plugin when selecting a shipping method radio (re-totals the cart via AJAX) in the default cart experience.

    Disabling this setting may fix this behavior, just in case someone runs into this.

    Regards,

    John

Leave a Reply to Andree Cancel reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Need to post PHP code? Wrap it in [php] and [/php] tags.