I have two domains, for example:
- example.com
- website.co.uk
I want to redirect in the following ways:
example.com
-->https://www.website.co.uk
alt.example.com
-->https://www.alt.website.co.uk
test.example.com
-->https://www.test.website.co.uk
As you can see, I want it always to force https
and www.
But, I also want it to remember the rest of the URL strcture, for example:
example.com/folder/index.html
-->https://www.website.com/folder/index.html
alt.example.com/test/
-->https://www.alt.website.com/test/
test.example.com/o/index.php
-->https://www.test.website.com/o/index.php
I'm not sure the best way for this to be done, the two options I found were to try rewrite rules and the other was a 301 redirect.