I'm attempting to allow users to access the same multisite content on a sub-site by using both www.example.com as well as www.example.org.

Upon initial setup, I simply redirected all allowed hosts / server aliases (e.g. www.example.org) to the Server Name entry (e.g. www.example.com). This worked fine for the last few months.

However, I was recently approached by the client who is requesting the requested domain remain in the browser's address bar (a simple redirect from an Apache no longer fulfills client requirements). They are in the non-profit sector and the .org extension is important to them.

With single-site setups, I'd usually use update_option('siteUrl', $_SERVER['SERVER_NAME']) to achieve this functionality. However, with a multisite, my research suggests that those hooks do not work the same way.

What is the secret to doing this? I find it hard to believe we can't have a similar functionality in the multisite world.

  • 1
    Sounds like SEO suicide. Duplicate content. Just don't do that. Instead simply redirect all your traffic to the *.org URL and update WordPress' site_url accordingly. – leymannx Apr 15 at 6:28
  • 1
    Agreed with @leymannx don't have the same content on both URLs, unless you really know how to setup canonical link rel URLs. Setup a 301 redirect from one TLD to the other – Alexander Holsgrove Apr 15 at 10:35

Your Answer

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

Browse other questions tagged or ask your own question.