You can now set up redirects directly in the domain settings of your Odoo instance.
Redirect www to non-www, non-www to www, or any other domain you want. All subpages and folders are forwarded automatically, so the full path after the / stays intact.
Examples:
www.test123.com/shop → test123.com/shoptest123.com/about → www.test123.com/about
Both 301 permanent and 302 temporary redirects are supported.
To use this, make sure the redirecting domain points correctly by adding either a DNS CNAME record to your main domain, or a DNS A record to the same IP.
