I've got a wildcard DNS record, allowing all forms of *.domain.com, additionally I'm pointing several different domains at the same machine and using rewrite rules to direct requests to sub folders depending upon the url the request originates.
For instance domain1.com point to /sites/folder/domain1, domain2.com points to /sites/folder/domain2
My problem is, that i'm using the Apache var HTTP_HOST in this rule, which includes the sub domain so that sub1.domain1.com points to /sites/folder/sub1.domain1.com and with several hundred sub domains for each domain there is no way to create all those folder possibility.
My question: how to remove all sub-domains from the HTTP_HOST variable? This is what the ruleset looks like thus far:
RewriteRule ^file.xml$ sites/%{HTTP_HOST}/file.xml [L]
Which works, until a sub domain is included in the URL...