Has the following been suggested yet ??

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

  RewriteRule ^/gift/(.*)$ http://www.myserver.com/buy.jsp?gift=$1
  RewriteRule ^/refer/(.*)$ http://www.myserver.com/buy.jsp?refer=$1

  ProxyPass /gift !
  ProxyPass /refer !
  ProxyPass /download/ http://www.myserver.com/download/
  ProxyPassReverse /download/ http://www.myserver.com/download/
  ProxyPass / http://127.0.0.1:8080/
  ProxyPassReverse / http://127.0.0.1:8080/
</VirtualHost>


-ascs 

-----Original Message-----
From: Joost de Heer [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 21, 2006 4:53 PM
To: Axel-Stéphane SMORGRAV; [EMAIL PROTECTED]
Cc: users@httpd.apache.org
Subject: RE: [EMAIL PROTECTED] Re: RewriteRule being ignored

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: [EMAIL PROTECTED]
   "   from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to