httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron Morris <aaronmor...@mindspring.com>
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 
list.

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 "http://httpd.apache.org/docs", mod_dir issues a 301 
redirect to "http://httpd.apache.org/docs/".  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  "http://httpd.apache.org:10000/docs/"

I have a workaround using mod_rewrite:

RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} -d
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.

Thanks.

-- 
Aaron W Morris <aaronmorris@mindspring.com> (decep)
PGP Key ID:  259978D1



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