Welcome to WebmasterWorld Guest from

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Bug in Apache 1.3?

Discrepancy between documentation and actual behaviour



9:38 pm on Nov 18, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member


Contrary to this claim in Apacheīs documentation [httpd.apache.org]:

<Files> and Options:

Apache won't check for it, but using an Options directive inside a <Files> section has no effect.

Options directives inside <Files> sections do have an effect.

How To Reproduce This Behaviour

Modify your httpd.conf to contain:

<Files index.html> 
Options -FollowSymLinks
# This should be changed to whatever you set DocumentRoot to.
<Directory "/var/www/html">
# This controls which options the .htaccess files in directories can
# override. Can also be "All", or any combination of "Options",
# "FileInfo", "AuthConfig", and "Limit"
AllowOverride All

Put a .htaccess file with the following content in a directory:

RewriteEngine On 
RewriteRule index.aaron index.html

Request /index.aaron. This will result in an error message like this one:

Options FollowSymLinks or SymLinksIfOwnerMatch is off 
which implies that RewriteRule directive is forbidden

Note that we get this error message even though we requested /index.aaron not /index.html. As you can see from the rewrite log rewriting does take place. With the new URL mod_rewrite initiates a sub request to /index.html. Now the <File> section applies and FollowSymLinks privileged are revoked.

strip per-dir prefix: /var/www/html/index.aaron -> index.aaron 
applying pattern 'index.aaron' to uri 'index.aaron'
rewrite index.aaron -> index.html
add per-dir prefix: index.html -> /var/www/html/index.html
strip document_root prefix: /var/www/html/index.html -> /index.html
internal redirect with /index.html [INTERNAL REDIRECT]


Donīt use Options in <Files> sections if it causes problems ;)

Setting Options FollowSymLinks anywhere in a Directory context wonīt help since <Files> sections are evaluated after <Directory> sections.


jeremy goodrich

8:35 pm on Nov 21, 2002 (gmt 0)

WebmasterWorld Senior Member jeremy_goodrich is a WebmasterWorld Top Contributor of All Time 10+ Year Member

Great tutorial, as always.

Thanks for the well organized post.


9:34 pm on Nov 21, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member

Thanks for noting and taking the time to reply, Jeremy.



Featured Threads

Hot Threads This Week

Hot Threads This Month