This is a discussion on httpd "trailing slash" redirect in Apache/2.0.46 within the Linux Web Servers forums, part of the Web Server and Related Forums category; [Red Hat Enterprise Linux WS release 3 (Taroon Update 4)] [Linux 2.4.21-27.0.2.EL i686 i686 ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
[Red Hat Enterprise Linux WS release 3 (Taroon Update 4)]
[Linux 2.4.21-27.0.2.EL i686 i686 i386 GNU/Linux] [Server version: Apache/2.0.46] Accessing http://localhost/index works ok. Accessing http://localhost/ does not work: 404 Not Found - The requested URL /index was not found on this server. Apache/2.0.46 (Red Hat) Server at localhost Port 80. error_log reads: [error] [client 127.0.0.1] Attempt to serve directory: /var/www/html/ $ apachectl configtest Syntax OK http://httpd.apache.org/docs-2.0/mod/mod_dir.html says the DirectorySlash Directive is available in version 2.0.51 and later. Should I upgrade? Snipped relevant sections from httpd.conf: LoadModule dir_module modules/mod_dir.so DocumentRoot "/var/www/html" <Directory "/var/www/html"> Options Indexes FollowSymLinks AllowOverride None Order allow,deny Allow from all </Directory> DirectoryIndex index index.html The file /var/www/html/index exists and is readable. Please help me point out why "trailing slash" redirect does not work. -- S.T. |
|
|||
|
"Sigurd Trygg" <sigurdtrygg@hotmail.com> wrote in message news:<1113989347.582362.169170@l41g2000cwc.googleg roups.com>...
> Accessing http://localhost/ does not work: > > 404 Not Found - The requested URL /index was not found on this server. > Apache/2.0.46 (Red Hat) Server at localhost Port 80. I initially though this was an isolated Apache problem, but it seems to point to my use of HTML::Mason (1.28) and mod_perl (1.99_09). I think this is a issue with HTML::Mason and mod_perl, since httpd redirects fine when I comment out the following lines from httpd.conf: # PerlModule HTML::Mason::ApacheHandler # PerlRequire /var/session_handler.pl # <Location /> # SetHandler perl-script # PerlHandler SessionHandler # </Location> It turned out it the trailing slash redirect worked if I in httpd.conf replaced "Location" with "Directory", and added a RewriteRule to handle trailing slashes: RewriteEngine On RewriteRule /$ / [L] RewriteRule /(.*)/$ /$1/ [L] <Directory "/var/www/html"> SetHandler perl-script PerlHandler SessionHandler </Directory> BTW, I'm using CGI.pm (3.07) on perl 5.8.0. Thanks to Paolo Campanella and others on Mason-users@lists.sourceforge.net: http://marc.theaimsgroup.com/?l=maso...3911911284&w=2 It seems the combination of the different versions of HTML::Mason, mod_perl and httpd can bite your hand off. The Mason Wiki has some clues for those who wonder: http://www.masonhq.com/browse/all_nodes.html -- S.T. |