Im trying to redirect requests for a wildcard domain to a sub-directory.
ie. something.blah.domain.com
--> blah.domain.com/something
I dont know how to get the subdomain name to use in the rewrite rule.
Final Solution:
RewriteCond %{HTTP_HOST} !^blah\.domain\.com
RewriteCond %{HTTP_HOST} ^([^.]+)
RewriteRule ^(.*) /%1/$1 [L]
Or as pointed out by pilif
RewriteCond %{HTTP_HOST} ^([^.]+)\.media\.xnet\.tk$