httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Ionescu <robsie...@googlemail.com>
Subject Re: [users@httpd] Mod_rewrite and mod_proxy
Date Wed, 09 Nov 2005 17:04:26 GMT
LECONTE Laurent ROSI/SICOR wrote:
> 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 ?
> 

Hi.
Yes,

RewriteEngine on
# pattern does not start with /newsite; do nothing and chain with next
# rule
RewriteRule !^/newsite - [C]
# force external redirection with statuscode 301 and last rule
RewriteRule ^/(.*) /newsite/$1 [R=301,L]

#proxyPass for everyRequest
RewriteRule ^/(.*) http://internal.address.com/ [P,L]

ProxyPassReverse / http://internal.address.com/

-- 
HTH,
Robert

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