httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joost de Heer" <sang...@xs4all.nl>
Subject RE: [users@httpd] Re: RewriteRule being ignored
Date Tue, 21 Feb 2006 15:52:44 GMT
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