Hi .. I am trying to redirect ... http://webmail.domain.com/ to http://domain.com/webmail/ I have written following rewrite code inside one domain vhost file in /etc/httpd/conf/sites-enabled directory, but it is not working ... as ideas? rewriteEngine on rewriteLog "/var/log/httpd/rewrite_log" rewriteLogLevel 9 RewriteCond %{HTTP_HOST} ^webmail.dsvtrust.org$ RewriteRule ^(.*)$ http://dsvtrust.org/webmail/ [R=301,L]
Just above the line Include /etc/httpd/conf/sites-enabled/ I added following lines .. <VirtualHost *:80> ServerAlias webmail.* RewriteEngine On RewriteLog "/var/log/httpd/rewrite.log" RewriteLogLevel 3 RewriteCond %{HTTP_HOST} ^webmail\.(.+) [NC] RewriteRule (.*) http://%1/webmail/ [R=301,L] </VirtualHost>