httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom Evans <>
Subject Re: [users@httpd] virtual hosts and rewrite rules
Date Fri, 22 May 2009 08:30:32 GMT
On Fri, 2009-05-22 at 06:32 +0000, Melanie Pfefer wrote:
> Hi
> I have an apache instance where I defined several rewrite rules and ProxyPassReverse
that redirects to other web applications.
> I added a virtual host in the conf file 
> NameVirtualHost *:80
> <VirtualHost *:80>
> ServerAdmin
> DocumentRoot "/usr/local/apache2/htdocs"
> </VirtualHost>
> RewriteEngine On
> RewriteRule ….
> ProxyPass …
> ProxyPassReverse…
> <VirtualHost *:80>
> ….
> </VirtualHost>
> Now with this new virtual host, the rewrite rules are not working and I get broken links.
I had to comment all the VirtualHost settings.
> I thought that the rewrite rules will still work on the default virtual host but apparently
> What is missing if I want the rewrite rules to affect the default virtual host?
> thanks

If you have vhosts, then the default vhost is not what is specified
outside of the vhost tags, it is the first defined vhost in your conf
file. This means that any vhost level directives (like RewriteRules,
ProxyPass, Location blocks etc) must be defined inside a vhost container
to be relevant. Yours aren't, which is why they are ignored.



The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message