Forum Moderators: phranque
<VirtualHost IP>
ServerAlias domain.com
ServerAdmin webmaster@domain.com
DocumentRoot /home/domain/public_html
User domain
Group domain
ServerName www.domain.com
CustomLog /usr/local/apache/domlogs/domain.com combined
ScriptAlias /cgi-bin/ /home/domain/public_html/cgi-bin/Options -Indexes +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST}!^domain\.com [NC]
RewriteRule ^/(.*) [domain.com...] [R=301,L]AddType application/x-httpd-php .php .htm
</VirtualHost>
I did a test and found that when I add "Options -Indexes" in .htaccess then its working perfectly fine, I mean it disables directory listing. Now this is really strange thing happening here! The same thing is not working in httpd.conf and its working fine in .htaccess file.
Do you think is there any configuration fault in Apache?
Milan
If it is working in the .htaccess file I cannot see any reason why it would not be working in the httpd.conf upon restart.
Did another test of adding <Directory> in httpd.conf and that too is working fine.
<Directory /home/domain/public_html>
Options -Indexes
</Directory>
This is really getting out of my head! By the way my Apache version is 1.3.37 if that could give you some version specific clues.
Milan
Normally, if multiple Options could apply to a directory, then the most specific one is taken complete; the options are not merged. However if all the options on the Options directive are preceded by a + or - symbol, the options are merged. Any options preceded by a + are added to the options currently in force, and any options preceded by a - are removed from the options currently in force.
However, if another Options +/- directive is more-specifically scoped than the one you are trying to override Indexes with, then the override won't work until you scope it more specifically. This might explain why you are finding it necessary to put the Options directive into a <Directory> container or into .htaccess, where the scope is more specific.
At least, it's possible. This problem makes my head hurt...
Jim