Comet ISON, Mercury, Comet Encke, Earth, solar coronal mass ejection, Sun-watching Stereo_A HI1 space telescope 2013-11-21

WordPress 3 Multi-Site Domain Mapping

With WordPress 3 in Multi-Site Mode, and the Domain Mapping Plugin, you can map domain names to any of your blogs. I’ll walk you through the steps to install the plugin (you have to move a few files and edit some configuration settings). Then I’ll show how to specify the mappings you want. (There are several blogs with partial instructions, that didn’t explain the configuration settings and didn’t give examples of how to specify the mappings — but you won’t have to figure it out because I did!)

Domain Mapping Plug-in Installation

Follow my instructions in WordPress 3 Multi-Site Installation to configure WordPress for multi-site, and install the Domain Mapping plugin. (Do not just use the WordPress plugin install, there are files you must move to special locations, and you must edit some configuration files. And there are conflicting instructions for the plug-in at different web sites.)

Gotchas

You must have WordPress installed in the root of your hosting account (/public_html/) or in the root of a subdomain (for example, /public_html/yoursubdomain/) domain mapping will not work. You can Not install WordPress in a Folder and have multi-site domain mapping work. Follow my Multi-Site Installation (above link) if you need to move an existing site and/or move WordPress.

Don’t put the domain that WordPress itself is in, into a mapping (e.g. lernerconsulting.info). Gives error “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”. Worse, you then can’t access WordPress at all. If you do put the domain in, you will have to delete the record using phpMyAdmin, in the wp3_domain_mapping table. [If that doesn't make sense to you, have a database person do that for you; don't fumble around in phpMyAdmin.]

Note: I am giving instructions for Apache web servers. If you must use a Microsoft IIS server, it definitely can work with multi-site and domain mapping, and you will need to be able to do things like set up wildcard DNS and edit the extremely picky web.config file — I feel for your suffering.

Configuration

In Network Settings

Network Settings (/wp-admin/network/settings.php):
Set “Network Name” as you want (e.g. “Lerner Consulting Network”). This will show on the “Add your New Blog” screen, “Get another {YOUR NETWORK NAME} site in seconds”.

Set “Network Admin Email” to one of your valid email accounts, where you want to be notified of new registrations and comments.

Set “Allow new registrations” how you want. I have mine set to “Registration is disabled”, since I can create new blogs from the Network Admin, Sites menu. If you select “Both sites and user accounts can be registered.” then you will get spammers creating blogs on your network, so you’d better have every other security measure in place.

You probably want to have “Allow site administrators to add new users to their site via the “Users → Add New” page” checked. They can not add Super-Administrators (able to install plugins or change things across all sites), they can add Administrators (able to change settings for their site, delete posts written by others on their site, etc.)

In “Banned Names” I put the folder names used by my non-WordPress web sites. (If you’re the only one permitted to create blogs, you can leave this field empty, and just remember.)

Here’s some of my banned names: admin administrator articlesite audio blog calendar cgi-bin fonts images lists main root shared web www. Since it’s so popular, block hackers trying to use “blog” by having it in the banned list, if you aren’t using it.

 

In Settings, Network Setup

Nothing to do, informational only.

In the My Sites menu, select Network Admin, Sites

At the top of the screen click the Screen Options button
Change the Show on Screen to 999 sites. (Otherwise, it only shows a few, very awkward.)

In Settings, Domain Mapping

/wp-admin/network/settings.php?page=dm_admin_page

(These settings work while setting things up, and when using the blogs. I’m not sure what other combinations work.)

Domain Options (x means checked, _ means unchecked)
_ Remote Login
x Permanent redirect (better for your blogger’s pagerank)
x User domain mapping page
_ Redirect administration pages to site’s original domain
_ Disable primary domain check.

Note: After changing the Domain Mapping Configuration, you should run Update Network – /wp-admin/network/upgrade.php

Easy Way: User Domain Mapping page

If this doesn’t work, something isn’t configured right; follow the rest of the instructions to get everything configured right.

For this to work, it has to be enabled in Network Settings, Domain Mapping (checkmark for the User Domain Mapping page, see above).

In the My Sites menu, select Network Admin, Sites
/wp-admin/network/sites.php

Hover over the blog name (or the Edit link) for the site you want to map to a domain.

Click the Dashboard link.

In the Tools menu, select Domain Mapping
/wp-admin/tools.php?page=domainmapping

In the “Add new domain” section, type the subdomain you want, without leading “http://” or trailing slash. For example, if you own yummyfish.com and you want to access your blog with http://salmon.yummyfish.com then you type salmon.yummyfish.com .

Check the “Primary domain for this blog” box.

When you click “Add”, you will see the mapping in “Active domains on this blog”

[I recommend have Primary checked on the mapped domain. If you have the WordPress domain set as Primary, visitors will see that domain for logging in and making comments. Having the mapped domain set as primary may be better for search engines. With Primary checked for the mapped domain, you access /wp-admin/ via the mapped domain; if you try accessing it through your WordPress domain (the unmapped Dashboard URL for this blog), you will get automatically redirected.]

 

 

Notice the server name shown, so you can add a DNS “CNAME” record pointing to it. If you are on a shared hosting account, you would do this by adding an add-on domain, or have your hosting provider set it up for you.

Note: In the Sites page /wp-admin/network/sites.php the Dashboard and Visit links will remain showing the WordPress domain. You will see the mapping you entered, in the Mapping column. The Dashboard and Visit links will redirect to the mapping you set.

Test if you can access the blog via the mapping you set. Test you can access the Dashboard via the mapping you just set followed by /wp-admin/ and if both work, you’re done.

If the mapping did not work, you will have to follow the full instructions, below.

Detailed Configuration

In Sites

In the My Sites menu, select Network Admin, Sites
/wp-admin/network/sites.php

If you were trying to get domain mapping to work, you may well have tried changing these settings. Nope, you need to set them back to the default (the settings that would be there when you create a new blog and haven’t modified anything).

Hover over the blog name so a menu appears, hover over the Dashboard link, right click, copy the link location.

Still hovering over this blog’s menu, Click Edit

In the Domain field, paste the link location (the Dashboard location).

Delete the http:// from the beginning, and delete the /wp-admin/ from the end.

Example: If the Dashboard location is http://opera.lernerconsulting.info/wp-admin/, then you would have opera.lernerconsulting.info . Note: no trailing slash.

In the Path field, type a slash / . (Note: I’m giving instructions for a SubDomain setup. Someone who has a SubFolder setup, please let me know what works.)

Put a checkmark by “Update siteurl and home as well”.

When you click “Save Changes” you will get a message near the top of the screen, “Site info updated.” and the “Edit Site” location at the top of the screen will show the new location. If you have it correct, clicking this “Edit Site” link will display your blog.

Repeat this for each site (blog) in your network. All sites, mapped or not, should be set this way.

In Settings, Domains

/wp-admin/network/settings.php?page=dm_domains_admin

This is where the magic happens. You will need to know your site IDs before you can use this page.

Getting Site IDs

From My Sites, Network Admin, Sites
/wp-admin/network/settings.php

Hover over the blog name (or the Edit link) for the site you want to map to a domain. You will see a link like “http://…/wp-admin/network/site-info.php?id=15
The Site ID is at the end (e.g. 15). You will need this number.

Make a list of all of the Site IDs you will be mapping.

Mapping, Via Network Settings Domains

If this works on one mapping (i.e. everything is configured properly now), the User Domain Mapping (see above) will also work, if you enabled it. This is easier for mapping several domains at once (less browsing to different domains); User Domain Mapping is easier for an occasional mapping.

From My Sites, Network Admin, Sites, in the Settings menu, Domains
/wp-admin/network/settings.php?page=dm_domains_admin

Delete any incorrectly entered domains (e.g. the site ID isn’t correct)

Note: do Not enter your WordPress domain to be mapped.

 

 

In the “New Domain” section,

Enter the Site ID from the step above (Network, Sites)
Enter the sub-domain you want mapped for that site (without leading “http://” or trailing slash)
example domain: homesforsale.glerner.com
example domain: liquidfluoridethoriumreactor.glerner.com

Check “Primary” if you want http://blogsubdomain.domain.com to be what visitors see when making comments, when logging in, etc. (I recommend this, easier for your visitors, and perhaps better for search engines.)

If you want multiple blogs for a domain name, make a separate record for each, with the correct Site ID in each.

You should now see the mapping listed in the Mapping column of the Network Sites page. You should be able to access the blog from the domain you mapped (or get redirected there from the un-mapped address). The Dashboard for the blog should work from both domains.

One thought on “WordPress 3 Multi-Site Domain Mapping”

Leave a Reply