2

Here is my situation: We have a multisite set up for a .com domain with multiple subdomains:

en.domain.com, fr.domain.com, es.domain.com, etc.

For legal reasons when our visitors come from the European Union we must use a .eu TLD in a way that our site will appear as domain.eu, en.domain.eu, fr.domain.eu etc. and while browsing the site the visitor should see all the pages under the european TLD. (we serve different

While pointing a domain to specific directory on the server isn't big of a deal since we use define('NOBLOGREDIRECT', 'https://domain.com'); obviously the .eu domain currently resolves to the front page .com

So my question is Is it possible to map two domain to the same multisite installation while preserving the sub-domain structure and allowing the visitors to browse the network under different TLDs

Any help will be highly appreciated.

3
  • 2
    Have you seen this answer. Could solve issue with small adjustements.
    – fuxia
    May 7, 2013 at 6:56
  • Tried it, T., but it didn't work. I'm assuming the solution should be different for multisite? What kind of adjustments you had in mind if you don't mind me asking? May 7, 2013 at 15:13
  • You might have to redefine DOMAIN_CURRENT_SITE too. Not tested.
    – fuxia
    May 7, 2013 at 16:58

1 Answer 1

3

What I basically did was the following:

  1. Used Domain Mapping plugin

  2. in wp-config.php - Changed

DOMAIN_CURRENT_SITE and NOBLOGREDIRECT to $_SERVER['HTTP_HOST'] as per what @toscho suggested

  1. in wp-config.php - Added:

    define('DOMAINMAPPING_ALLOWMULTI', 'yes'); // Allow sites to have multiple domains

    define('SUNRISE', 'on'); // Domain mapping plugin activation

  2. mapped relevant sub.domain.com to relevant sub.domain.eu

  3. The main site can not be mapped via the plugin though, so I added a new entry in the wp_domain_mapping table in the database for site 1 to point to domain.eu, just like Domain Mapping did for the rest of the subdomains.

    site_id 1 to domain.eu

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.