httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sean O'Neill <>
Subject Re: [users@httpd] RESOLVED - Problem with Rev Proxy config and mod_rewrite
Date Thu, 06 Mar 2003 16:47:22 GMT

Date: Thu, 06 Mar 2003 10:45:06 -0600
From: Sean O'Neill <>
Subject: Re: [users@httpd] RESOLVED - Problem with Rev Proxy config and 

At 11:58 PM 3/5/2003 -0600, Sean O'Neill wrote:
>Using Apache 2.0.44 for this exercise.
>This is what I have:
>- I have a FreeBSD machine behind a firewall on a nonroutable network 
>running Subversion on Apache.  To get to this subversion repository on 
>this machine directly (while on the same subnet), you hit 
>"".  You'll get back a simply list of 
>one document (a README file) and 3 directories which are all links.
>- On the firewall I have Apache 2.0.44 running - just assume its 
> for this discussion.  I've got the following config for 
>the Reverse Proxy setup:
>RewriteRule ^/repos/?$ [NC,P]
>RewriteRule ^/repos/(.*/)$$1 [NC,P]
>RewriteRule ^/repos/(.*[^/])$$1/ [NC,P]
>ProxyPassReverse /repos


>So my question is why the difference in how the URL is fully qualified 
>from the "<a href="README">README</a>" source depending on how you hit the

>link e.g. reverse proxy vs. direct ?  What makes my browser qualify the 
>same HTML source into different URLs obviously ignoring the hostname 
>portion of the URL?

Subversion (in Apache) requires directory URIs to end in "/" 
character.  That's what my RewriteRules above are for.  If you hit the 
Subversion Apache directory as "" 
(notice no trailing "/") you get back a 301 response redirecting you to 
"" (notice the trailing "/").

Well, when going through the reverse proxy, the end-user browser never gets 
the 301 - the Apache Reverse Proxy does.  So the client never adjusts it 
understanding of how to interpret the HTML source.

By adding this on the Reverse Proxy:

Redirect permanent /repos

before the other rules, the end-user browser now gets a 301 and it properly 
handles the link qualification correctly.

......... ..- -. .. -..- .-. ..- .-.. . ... ............
.-- .. -. -... .-.. --- .-- ... -.. .-. --- --- .-.. ...

Sean O'Neill 

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message