7

Using WP 4.5.2

Even the developer of the WordPress.org plugin for domain mapping in a multisite network says to not use the plugin any more -- since core WP now includes the same functionality.

Does anyone know of any end-to-end instructions about how to get this to work? I tried setting a CNAME pointer in my registrar to one of my network sites, and changed the site URL in admin->network->edit site->info->Site Address (URL) to the name of the registered domain -- and it still lands me at a "site doesn't exist" page at my hosting company.

I have a feeling it's due to not having a dedicated IP address for the multisite instance, but before I purchase another hosting plan and pay for a dedicated IP address I wanted to REALLY understand how domain mapping is supposed to be set up, in WP 4.5 multisite.

Any help, insight or pointer to a good reference would be very appreciated.

  • Can you please outline where the developer states to not use the plugin? I'm using it myself so raising a concern. :) I would love a comprehensive answer to this for us who have been relying on this plugin... – Christine Cooper Jun 12 '16 at 13:01
  • @ChristineCooper - several threads in the plugin support forum; here's one example: wordpress.org/support/topic/wp-45 – C C Jun 12 '16 at 15:36
  • Hier is your answer, is possible without a plugin since a lot of versions of WP. wordpress.stackexchange.com/a/182467/170 – bueltge Jun 12 '16 at 17:04
  • 2
  • 2
    I don't think my question is a duplicate of the other question you cited. There was a significant change to the domain mapping code inside of WP going from 4.1 to 4.5. The admin interface is also different, on the site settings page. I will try the instructions given for 4.1 to see if it works but so far I have not been successful. – C C Jun 13 '16 at 12:26
4

Here's an example of a solution I configured, which leaves the site in the network, but establishes a domain map from any registered domain, to the network. It makes the network site appear to be a completely independent site, with all the functionality (log-in, etc.) intact.

Goal:

Map client's registered domain, both www.foosite.com and foosite.com over to our multisite network mymultisite.com - and make it as easy as possible on the client (i.e. no mucking around with CNAME or A records, at their registrar).

Procedure:

Using Amazon Route 53 as the DNS system.

  1. With Amazon AWS Route 53 handles the DNS, so we first create a hosted zone for the client's registered domain (foosite.com) with a www CNAME record pointing to www.mymultisite.com

  2. Set up an S3 bucket in Amazon AWS for the (non-www) client's foosite.com and statically map that to www.foosite.com

  3. Back in the Route 53 hosted zone, create an A record for the (non-www) foosite.com and specify it as an Alias, pointing it to the bucket created in step 2. This assures that both www.foosite.com and foosite.com will end up pointing to www.mymultisite.com

  4. In the multisite network, go to the client's site in network admin and edit the site URL, changing it to www.foosite.com

  5. In the hosting account that hosts mymultisite.com specify an add-on domain (or a parked domain) called foosite.com and point it to public_html (or wherever you have WP installed). This effectively creates a virtual host record in Apache config, for the incoming mapped site.

(note: If the multisite is hosted at a static IP address and is the only site at that address, and the hosting company allows dynamic mapping of incoming domains to the site's document root...then you don't have to use add-on or parked domains. Check with your hosting company if unsure).

  1. In your wp-config.php for the multisite, you need to add a line: define('COOKIE_DOMAIN', $_SERVER['HTTP_HOST'] ); If you have any issues with this setting, you may want to try define('COOKIE_DOMAIN', '');).

Result:

You've established a complete DNS solution for the mapped domain. All you have to do is tell the client to update their registrar for their domain, specifying the Amazon nameservers that are recorded in your hosted zone at Route 53 as their DNS. Your clients don't have to mess around with CNAME or A records at all - you are handling the mapping completely, at Route 53. Furthermore, due to the magic of the AWS Alias record, your multisite doesn't even need to be on a static IP address (although I keep it on one, just to be safe).

If using another system as the nameserver (e.g. Enom, or GoDaddy), you'd set up an A record for their domain which points to the static IP address of mymultisite.com. This is an ok answer but it carries the risk that if your static IP address ever changes, you'd have to tell your clients to go update the A record at their registrar.

I like the Route 53 solution a lot better. I also established a "white label" set of DNS at AWS following the guidance in this article. Now it is extremely simple - just tell clients here are your new nameservers to set at your registrar, and everything on the WP side works flawlessly. No need to maintain a static IP address in an A record.

Here is what the Hosted Zone looks like for foosite.com:

foosite.com     A     ALIAS <name of S3 bucket>
footsite.com    NS    ns1.vanityns.com; ns2.vanityns.com; ns3.vanityns.com; ns4.vanityns.com
foosite.com     SOA   ns1.vanityns.com hostmaster.vanityns.com x x x x
www.foosite.com CNAME www.mymultisite.com

Setting up the vanity nameserver is too much to enter here; follow the directions in that article I linked. One additional point on that: make sure for the nameserver entries for the vanity nameserver itself, you specify the list of vanity nameservers with glue records connecting to the real IP addresses of the actual AWS assigned nameservers in your reusable delegation set.

This boils down around 20 hours of research/experimentation into what worked out for me.

  • So, where do I add the SSL Cert for the mapped domain? – Michael Robinson Jan 9 '18 at 20:31
  • @MichaelRobinson, I have not tried this yet. I would imagine you would add the cert to the server just like for any other domain. – C C Jan 10 '18 at 14:48
  • SSL answer, here: wordpress.stackexchange.com/questions/306576/… – C C Jun 26 '18 at 2:23

protected by Community Jan 9 '18 at 21:22

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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