If so, and you use CloudFlare for your DNS and proxy service, instead of fussing with your web server rewrites to do so, make full use of CF's rules.
It's is every easy to do as you just go into your domain setting that you want to do the rewrite for and then choose the rules option.
Once you do, choose the
The nice thing about this is it can keep the original query string, unlike what some rewrites do.
Set your redirects up similar to this
Just changing the
Then in the
I use the preserve query string checkbox and I also prefer to use a 302 status code instead of a 301, just in case I later want that domain to actually resolve to a website.
The benefit of doing it this way is it redirects before ever hitting your hosting instance, so it is almost no impact on your server.
It's is every easy to do as you just go into your domain setting that you want to do the rewrite for and then choose the rules option.
Once you do, choose the
Redirect to a different domain
option and Create a rule
.The nice thing about this is it can keep the original query string, unlike what some rewrites do.
Set your redirects up similar to this
Just changing the
value
string to reflect the hostname you are working with. As you can see, I do both the root domain and the WWW
subdomain.Then in the
Then
area point it at the domain you want it to resolve to.I use the preserve query string checkbox and I also prefer to use a 302 status code instead of a 301, just in case I later want that domain to actually resolve to a website.
The benefit of doing it this way is it redirects before ever hitting your hosting instance, so it is almost no impact on your server.