I am looking to make www.purchase.domain.com redirect to purchase.domain.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.domain.com
Obviously i can hard code the purchase.domain.com but i will need the code to work on multiple sites. Any suggestions?
You could use a RewriteCond backreference.
Untested:
Which suprisingly similar to the one posted while I was posting.