1

I currently have a multisite install with 4 sites and 4 domains, like so:

Site 1 -> site1.com

Site 2 -> site2.com

Site 3 -> site3.com

Site 4 -> site4.com

There was a typo in the domain of Site 3, so we changed site3.com to site3-new.com. So far so good. Now we want site3-new.com to show Site 3, and we want site3.com to show site3-new.com.

That last step is causing me endless headache. What's happening right now is that visiting site3-new.com opens up Site 3, while visiting site3.com opens Site 1 (it redirects 302 to site1.com), presumably because in wp-config site1.com is set as 'DOMAIN_CURRENT_SITE'.

What can I do to show 1 site from the multisite instalation for 2 separate domains?

Thanks.

2
  • Have you tried an .htaccess redirect? If you place it in the root folder of site3.com and 301 redirect everything to site3-new.com that should do it.
    – WebElaine
    Apr 25 '17 at 15:29
  • You need to show your wp-config.php custom settings. If you are using multiple domains, you cannot set DOMAIN_CURRENT_SITE to a static setting.
    – user42826
    Apr 25 '17 at 17:14
2

I think the best way to have multiple domains on the same Multisite installation is to have a different network for each domain using https://wordpress.org/plugins/wp-multi-network/.

details of the wp-config.php setup is (including DOMAIN_CURRENT_SITE) is here https://github.com/stuttter/wp-multi-network#domainsub-domain-flexibility

But over all it depends on what interaction you want between the sites.

2

In vanilla WP, a site cannot serve multiple domains like that unless it's the root site.

Additionally, your desired setup would lead you to one of two situations:

  1. You're succesfully serving the site on 2 domains, but all the canonical tags point to the first domain regardless of which is setup
  2. Google sees duplicated content and hits both sites with an SEO penalty

Which leads us to the SEO friendly, simpler more performant solution:

Set up your Host to redirect site3.com to site3-new.com, and only serve WP from site3-new.com. Any visitors to site3.com would get a 301 redirect to site3-new.com. This updates all the search engine results too.

You can do this via Nginx or HTAccess rules, but most hosts have a point and click option to do this in their hosting panels, even some DNS providers will do this for you.

Otherwise you would need to install a plugin for doman mapping. But this would be an inferior solution for your problem with various disadvantages.

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.