Re: virtual hosts and rewrite rules

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

 



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 you@xxxxxxxxxxx
> 
> 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 no.
> 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.

Cheers

Tom


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux