httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Axel-Stéphane SMORGRAV <Axel-Stephane.SMORG...@europe.adp.com>
Subject RE: [users@httpd] Re: RewriteRule being ignored
Date Tue, 21 Feb 2006 17:28:35 GMT
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:sanguis@xs4all.nl] 
Sent: Tuesday, February 21, 2006 4:53 PM
To: Axel-Stéphane SMORGRAV; dbhull1@hotmail.com
Cc: users@httpd.apache.org
Subject: RE: [users@httpd] 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: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message