httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron Morris <>
Subject [users@httpd] Modifing the behavior of mod_dir redirects
Date Fri, 20 Jun 2003 21:31:16 GMT
I want to pose a question to the user list before trying the developers 

AIX 5.1 ML3
Apache 1.3.26 (actually IBM HTTP Server 1.3.26)

I having a problem with the redirect behavior in mod_dir.  In my 
environment, when a request comes in, a NAT device changes the 
destination address as well as the destination port.  When the response 
is sent back, the device changes the source IP and the source port. 
Standard static NATing.  The problem comes in when mod_dir redirects 
requests for directories without a trailing slash.

ie  A request to "", mod_dir issues a 301 
redirect to "".  In my environment, since 
Apache receives the request on a different port number the redirect 
reflects the internal port number instead of the port from the 
perspective of the internet.  ie  ""

I have a workaround using mod_rewrite:

RewriteRule ^/(.+[^/])$ http://%{HTTP_HOST}/$1/ [R]

This works for HTTP requests, but HTTPS requests (in IBMs IHS SSL 
module, not sure about mod_ssl), apparently, do not pass through 
mod_rewrite, so the standard mod_dir behavior applies.  It seems to me 
that it might be worth the effort to be able to modify the behavior of 
the mod_dir redirects.  Something like a directive to tell mod_dir to 
use the HOST header for the redirect.

I know my environment is not a standard setup, but I also know that it 
is not all that unusual.  I just wanted to bounce this idea off this 
list before moving it up the developers list.  Any feedback would be great.


Aaron W Morris <> (decep)
PGP Key ID:  259978D1

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