0

I have 3 different domains for a single WordPress project (for example, www.aaa.com, www.bbb.com, www.ccc.com). www.aaa.com is the main domain. The problem is, whenever I access the page that WordPress did the URL guessing on other domains, it will redirect to the main domain with 301 code. Here is an example of the current situation:

www.aaa.com/en --> www.aaa.com/en/
www.bbb.com/en --> www.aaa.com/en/
www.ccc.com/location/ --> www.aaa.com/aboutus/location/

What my expectation is it will redirect according to its own domain, like:

www.bbb.com/en --> www.bbb.com/en/

I am not sure which part should I check on. I really appreciate anyone's help.

1 Answer 1

0

This is intended behaviour for WordPress install and will use the value set in the siteurl entry in the options table.

What you want to achieve will probably have to be done with Nginx or Apache using Rewrites, or proxy_pass (for Nginx) or RewriteRule and ProxyPass (Apache)

1
  • You could also put something in wp-config or sunrise to recognise the three valid domains (with and without www) and switch the siteurl to whichever one the request is using. Which is a bit of a hack though.
    – Rup
    Commented Jan 11, 2022 at 11:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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