I enabled multisite on my new project and have the following setup:
domain - central website shop.domain - store network.domain - BuddyPress install
Right now I need to add the following: countrydomain - website for different country and someday probably: countryb - additional country / countries
Long story short, I need to use multisite with additional domains and subdomains. Everything works perfectly with subdomains, but when I try to add another domain, the most I can achieve is extra domain redirecting to subdomain.
Is there a way to map the domain to one of the sites in the network and how can you acomplish this without 3d party plugins?
I enabled multisite on my new project and have the following setup:
domain - central website shop.domain - store network.domain - BuddyPress install
Right now I need to add the following: countrydomain - website for different country and someday probably: countryb - additional country / countries
Long story short, I need to use multisite with additional domains and subdomains. Everything works perfectly with subdomains, but when I try to add another domain, the most I can achieve is extra domain redirecting to subdomain.
Is there a way to map the domain to one of the sites in the network and how can you acomplish this without 3d party plugins?
Share Improve this question asked Feb 15, 2017 at 13:50 Marko JezernikMarko Jezernik 15810 bronze badges 1- Try searching for ccTLDs, i know this has been possible in core since 4.2 – David Lee Commented Feb 15, 2017 at 14:10
1 Answer
Reset to default 1Here are the high level steps if you are on 4.2 or greater:
Have your multisite hosted at a dedicated IP address.
Go into your network dashboard
My Sites > Network Admin > Sites
and edit the site you want to map, by changing its url tohttp://example
(no www).At the registrar for the domain, set an A record that points to the multisite dedicated IP address, and a CNAME record for WWW that points to the TLD for the domain (e.g.
CNAME www.example -> example
).In your
wp-config.php
file set this line:define( 'COOKIE_DOMAIN', '' );
Now, when you bring up www.example
or example
in the browser it will be serving up example.multisite
- and nobody will ever know; 100% domain mapped success.
Note that if you want to go next level with this and be a mapping superstar, you'll need to use my instructions for leveraging AWS (or CloudFlare), and possibly running white-label nameservers. With that scenario you don't even need the multisite at a dedicated IP address since you'd be using the AWS augmented "alias" record...but I still have mine at a dedicated IP address because some clients will still want to run DNS externally (e.g. Microsoft Office online...).