Hi,
when you use virtual hosts you can put mod_rewrite inside a directory block or inside a virtualhost block.
If you put mod_rewrite outside those blocks the rules *won't be parsed*.
That's happen when you use virtual hosts.
I'm not sure what you are going to do,
could you give to me an example ?
By the way you need to split the two rules you wrote:
Code:
<VirtualHost *>
ServerName www.host1.com
DocumentRoot "/var/www/html/host1"
ErrorLog /var/log/httpd/error1.log
CustomLog /var/log/httpd/access1.log common
RewriteEngine on
RewriteRule ^(.*)$ /host1$1 [PT]
<Location "/host1">
</Location>
<Location "/host1/*">
</Location>
</VirtualHost>
<VirtualHost *>
ServerName www.host2.com
DocumentRoot "/var/www/html/host2"
ErrorLog /var/log/httpd/error2.log
CustomLog /var/log/httpd/access2.log common
RewriteEngine on
RewriteRule ^(.*)$ /host2$1 [PT]
<Location "/host2">
</Location>
<Location "/host2/*">
</Location>
</VirtualHost>
p.s.
/host2
means host2 under root...
Bookmarks