I am looking to make www.purchase.example.com
redirect to purchase.example.com
, below is an example of what I am trying to do:
RewriteCond %{HTTP_HOST} ^www\.purchase\.
RewriteRule (.*) http://purchase.DOMAIN_NAME/$1 [L,R]
I need a variable that will replace DOMAIN_NAME
with simply purchase.example.com
.
Obviously I can hard code the purchase.example.com
but I will need the code to work on multiple sites. Any suggestions?