Actually, writing my last mail gave me an idea : I scratched the ProxyPass 
directive altogether, and added a 'dummy' Rewrite for the correctly-written 
URLs. Therefore my conf now looks like this :

RewriteRule ^/newsite/(.*) http://internal.address.com/newsite/$1 [P,L]
RewriteRule ^/html/(.*) http://internal.address.com/newsite/html/$1 [P,L]
...
#no more ProxyPass
ProxyPassReverse / http://internal.address.com/

This takes care of my problem. However, the bad URLs 
(http://external.address.com/html/...), although correctly redirected, aren't 
updated in the browser address bar (I'd like them to become 
http://external.address.com/newsite/html/...). Any idea how I could correct 
that ?

Laurent Leconte

-----Message d'origine-----
De : Simon Irwin [mailto:[EMAIL PROTECTED]
Envoyé : mercredi 9 novembre 2005 17:27
À : users@httpd.apache.org
Objet : Re: [EMAIL PROTECTED] Mod_rewrite and mod_proxy

Laurent -

did you test whether mod_rewrite will work on any requests if you remove the 
ProxyPass directives?  it would be good to find out if the rewrite engine is 
basically working for you.

if you can prove the rewrite engine works, perhaps you could avoid using 
ProxyPass/ProxyPassReverse altogether and instead implement of all your 
redirects using only mod_rewrite's RewriteRule directives.

cheers
Simon

On 11/9/05, LECONTE Laurent ROSI/SICOR
<[EMAIL PROTECTED]> wrote:
>
> Hello all,
>
> I've configured an Apache 2.0 instance to work as a reverse proxy,
> listening on external.address.com and redirecting to
> internal.address.com.
>
> The relevant lines of the httpd.conf file are :
>
> Listen external.address.com:80
>
> <VirtualHost external.address.com:80>
> ProxyPass / http://internal.address.com/ ProxyPassReverse /
> http://internal.address.com/ </VirtualHost>
>
> This works fine, and all our URLs (which look like
> http://external.address.com/newsite/whatever) are correctly rerouted
> to http://internal.address.com/newsite/whatever
>
> However, we'd like to maintain backwards-compatibility with the old
> site. This means that the old URLs such as
> http://external.address.com/images/xyz or
> http://external.address.com/html/abc should be rewritten as
> http://external.address.com/newsite/images/xyz or
> http://external.address.com/newsite/html/abc BEFORE going through
> mod_proxy. Accordingly, I've tried modifying the VirtualHost section
> so
> :
>
> <VirtualHost external.address.com:80>
> RewriteEngine on
> RewriteLog /path/to/logs/rewrite_log
> RewriteLogLevel 100
> RewriteRule ^/images/(.*) /newsite/images/$1 [L] RewriteRule
> ^/html/(.*) /newsite/html/$1 [L] ...
> ProxyPass / http://internal.address.com/ ProxyPassReverse /
> http://internal.address.com/ </VirtualHost>
>
> This, however, doesn't work. The log file is created, but stays
> desesperately empty, and all the requests to
> http://external.address.com/html/abc are directly rerouted to
> http://internal.address.com/html/abc
>
> I've tried replacing [L] by [P] or [QSA] in the rules, and placing the
> Rewrite directives outside of the VirtualHost section, but that
> doesn't change anything. I've read in the archive that using [P] and
> removing the ProxyPass directive should work, but that would break the
> redirection for the new URLs.
>
> The httpd -l command shows mod_rewrite.c, so the module is indeed here.
>
> Any thoughts on what I'm doing wrong ?
>
> Thanks in advance.
>
> Regards,
> Laurent Leconte
>
>

***********************************
Ce message et toutes les pieces jointes (ci-apres le "message") sont 
confidentiels et etablis a l'intention exclusive de
ses destinataires.
Toute utilisation ou diffusion non autorisee est interdite.
Tout message electronique est susceptible d'alteration. Le Groupe France 
Telecom decline toute responsabilite au titre de
ce message s'il a ete altere, deforme ou falsifie.
Si vous n'etes pas destinataire de ce message, merci de le detruire 
immediatement et d'avertir l'expediteur.
***********************************
This message and any attachments (the "message") are confidential and intended 
solely for the addressees. Any unauthorised
use or dissemination is prohibited.
Messages are susceptible to alteration. France Telecom Group shall not be 
liable for the message if altered, changed or
falsified.
If you are not receiver of this message, please cancel it immediately and 
inform the sender.
***********************************

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