RE: [users@httpd] Re: RewriteRule being ignored

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

 



Axel-Stéphane  SMORGRAV wrote:
> If memory serve me right, all mod_proxy hooks execute before mod_rewrite
> in Apache 2.0. Module ordering is irrelevant.

In that case, reverse proxying must be done with mod_rewrite, something
like (untested!):

<VirtualHost *:80>
  ServerName www.myserver.com
  RewriteEngine On

  RewriteCond %{REQUEST_URI} ^/gift/.*
  RewriteRule ^/gift/(.*)$ http://www.myserver.com/buy.jsp?gift=$1
  RewriteCond %{REQUEST_URI} ^/gift/.*
  RewriteRule ^/refer/(.*)$ http://www.myserver.com/buy.jsp?refer=$1
  RewriteCond %{REQUEST_URI} ^/download/.*
  RewriteRule /(.*) http://www.myserver.com/$1 [P,L]
  RewriteRule /(.*) http://127.0.0.1:8080/$1 [P]

  ProxyPassReverse /download/ http://www.myserver.com/download/
  ProxyPassReverse / http://127.0.0.1:8080/
</VirtualHost>

Possibly with a few extra RewriteCond's to avoid looping.

Joost


---------------------------------------------------------------------
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