httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Allen Pulsifer" <>
Subject [users@httpd] httpd attempts to open file.html/.htaccess (is this a bug?)
Date Thu, 07 Jun 2007 15:59:59 GMT

When processing a "GET /.../file.html", Apache httpd briefly treats
file.html as a directory and attempts to open
"docroot/.../file.html/.htaccess".  The os returns ENOTDIR, and then
processing of the request continues.

There would seem to be no reason for httpd to attempt to open
file.html/.htaccess, especially since it has already done a stat on
file.html and knows that it is a file, not a directory.

Does anyone else see the same behavior?  Is this a bug?


Configuration: Apache httpd v 2.2.4 running on CentOS-5.  Tested with stock
configuration distributed with CentOS-5, as well as a stock installation
compiled from the source.

Only change to http.conf is:
"AllowOverride None" changed to "AllowOverride All"

DocumentRoot is "/var/www/html", and I created an html file at

Command is "curl -i http://localhost/dir/subdir/file.html"

Result of "strace -f -e trace=file /usr/sbin/httpd":

[pid 24550] stat64("/var/www/html/dir/subdir/file.html",
{st_mode=S_IFREG|0644, st_size=48, ...}) = 0
[pid 24550] open("/var/www/html/.htaccess", O_RDONLY|O_LARGEFILE) = -1
ENOENT (No such file or directory)
[pid 24550] open("/var/www/html/dir/.htaccess", O_RDONLY|O_LARGEFILE) = -1
ENOENT (No such file or directory)
[pid 24550] open("/var/www/html/dir/subdir/.htaccess", O_RDONLY|O_LARGEFILE)
= -1 ENOENT (No such file or directory)
[pid 24550] open("/var/www/html/dir/subdir/file.html/.htaccess",
O_RDONLY|O_LARGEFILE) = -1 ENOTDIR (Not a directory)
[pid 24550] open("/var/www/html/dir/subdir/file.html", O_RDONLY|O_LARGEFILE)
= 18

Note the open("/var/www/html/dir/subdir/file.html/.htaccess"), which
returned ENOENT.

It is believed that this bug is somewhere in ap_directory_walk() in

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