[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cobalt-users] Help with RewriteRules



I've found this code for subdomains (goes in httpd.conf) for setting up 
domains to go from abc.domain.com /home/httpd/html/abc.domain.com 
however I was wondering how this could be modified so that it removes 
the .domain.com when directing to a directory so that the path 
is /home/httpd/html/abc and secondly can it be done so it filters out 
the request if it starts with www. (doesn't go 
to /home/httpd/html/www.abc.domain.com if directed by 
www.abc.domain.com)

James Austin.


Code below:
_____________________________________________

RewriteEngine on 
RewriteCond %{HTTP_HOST} *.domain.com [NC] 
RewriteCond %{HTTP_HOST} !www.domain.com [NC] 
RewriteRule ^/(.*)$ /home/httpd/html/%{HTTP_HOST}/$1 [L] 
ServerAlias *.domain.com