2

I have a Wordpress multisite installation where the primary domain name is domain1.com. I have two other domain names set as alpha.domain1.com and beta.domain1.com which both correspond to domain2.com and domain3.com when accessed without logged in.

However when I login to any of these two subdomain sites, the admin is always alpha.domain1.com/wp-admin and beta.domain1.com/wp-admin

How do I make sure that these sub-domains work as domain2.com/wp-admin and domain3.com/wp-admin when logged in.

Just to add more context, the Siteurl and Home are set as alpha.domain1.com and beta.domain1.com for these two individual sites on http://domain1.com/wp-admin/network/site-settings.php

1

There are two commonly used mapping plugins for WordPress. For the next lines we assume you use the free WordPress MU Domain Mapping plugin from the WordPress plugin Repository.

From your post I understand you have correctly mapped your domains (you have a dedicated IP or have already set-up the CNAMEs correctly).
You have also correctly mapped your domains alpha.domain1.com to point to domain2.com and made domain2.com the primary domain.

mapping-01

What you are asking for is possible. You just need to make the correct configuration.

How to have the administration pages redirect to the mapped domain:

mapping02

  • Go to your "Network Settings" and click on "Domain Mapping".
  • Check the two options as at the image above. You don't need to have anything else checked.
  • Make sure you leave unchecked the "Redirect administration pages to network's original domain".

If you read the installation page:

  1. "Redirect administration pages to network's original domain (remote login disabled if this redirect is disabled)" - with this checked, if a user visits their dashboard on a mapped domain it will redirect to the dashboard on the non mapped domain. If you don't want this, remote login will be disabled for security reasons.

Do a final check by going to "Network Settings", "Sites", "Edit Site", "Settings".
Make sure both your "Siteurl" and "Home" fields point to your mapped domain.

mapping-03

The second mapping plugin is a paid one. You can find information on how to use it here.
If that is the one you use, under "Administration mapping" you should select one of the two options provided.

  • "domain entered by the user" gives the choice to the mapped site admin to point the administration area to either the mapped domain (domain2.com/wp-admin/) or the original domain (alpha.domain1.com/wp-admin/).
  • "mapped domain" enables the access to the admin area through the mapped domain (domain2.com/wp-admin/).
  • I was facing odd issue of 302 redirect while using wp_signout() function from a ajax call due to the 4rth option enabled in WP MU domain mapping settings. I unchecked it and it fixed my issue. – shivgre Aug 24 '17 at 23:43
0

I think you need Domain Mapping. Domain mapping allows a blog on a multisite install to serve from any domain name. This way a blog does not have to be a subdirectory of the main install, or a subdomain. The WordPress Default supports Domain Mapping without Alias. Add the Domain in the blog-settings to the blog of the Network administration area.

Older Answers

If you have usaged the search on WPSE, maybe you found this helpful thread 182467. Read it also, is much helpful.

Domain Setting with WP Core

You should add the domains to the site settings of each site in the Multisite.

Sites

See the follow example screenshot for a additional domain to other domain with directory structure. enter image description here

Site Info, Domain Setting

To set a domain, edit the site-settings, tab "Info", also a screenshot, helps much more - I think. enter image description here

Site Settings

Check also the settings, that the URL works for the site and the home-url. enter image description here

Additional Hint

Often is it helpful - but not necessary, to set the COOKIE_DOMAIN constant to an empty string in your wp-config.php:

define( 'COOKIE_DOMAIN', '' );

Otherwise WordPress will always set it to your network's $current_site->domain, which could cause issues in some situations.

WordPress Core and Domain Alias

WordPress can handle different domains inside the core, no additional plugin is necessary. A plugin is only important, if you use alias of a domain. If you will use it, then you have two possibilities form ready usable plugins.

  1. Mercator - WordPress multisite domain mapping for the modern era.
  2. WordPress MU Domain Mapping - Map any blog/site on a WordPressMU or WordPress 3.X network to an external domain.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.