httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leendert Bottelberghs <leend...@unitedknowledge.nl>
Subject [users@httpd] unusual path translation due to DirectoryIndex
Date Mon, 15 Mar 2004 15:54:29 GMT
Hi,

I have an apache (1.3.27) installed with mod_perl (among many other
modules). I use one of the virtual hosts to serve database content with
perl. This application uses the path information to retrieve specific
data, which is very common for such an application.
The configuration of this virtual host is roughly as follows:

<VirtualHost [ip]:[port]>
ServerName my.server.net
 <Files ~ "\.(pl)$">
   SetHandler perl-script
    PerlHandler Apache::Registry
    Options +ExecCGI
 </Files>
 DocumentRoot /www/my.server.net/www
 DirectoryIndex index.html index.pl
	<IfModule mod_rewrite.c>
		RewriteEngine On
		RewriteLogLevel 0
		RewriteLog /www/my.server.net/logs/rewrite_log
		RewriteCond /www/my.server.net/www/%{REQUEST_FILENAME} !-d
		RewriteCond /www/my.server.net/www/%{REQUEST_FILENAME} !-f
		RewriteRule ^(/.*) /index.pl$1 [PT]
	</IfModule>
</VirtualHost>

As you see I declare for the DirectoryIndex that the server has to look
for index.html first, and then for index.pl. I use this for occasions
when I want the site to be temporarily unavailable, so I can place an
index.html file in the directory which states just that.
Now this "strange" behavior occurs: the perl application receives
"/index.pl/index.html" as path information variables when I request the
site without *ANY* parameters (eg. http://my.server.net/). These are the
values of the environment variables I get when I don't have an
index.html file in the directory:

PATH_INFO = /index.pl/index.html
PATH_TRANSLATED = /www/my.server.net/www/index.pl/index.pl/index.html

It looks as if the filenames that Apache was looking for are added to
the path. These variables are also passed to the application, which
doesn't know what to do with it.
My questions: 
- Is this normal behaviour?
- Can this be circumvented or turned off in any way?

Any help would be appreciated. I will report this as a bug if the
answers to both of my questions are negative.

TIA,

Leendert Bottelberghs

Mime
View raw message