Apache Options -Indexes

Whether you are using Linux on the desktop or as a server, it's still good that you're using Linux. Linux related questions go here.

Moderator: General Moderators

Post Reply
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Apache Options -Indexes

Post by alex.barylski »

Here is my current .htaccess file:

Code: Select all

 
RewriteEngine on
RewriteBase /
 
Options -Indexes 
 
RewriteCond %{HTTP_HOST} ^pcspectra.com [NC]
RewriteRule ^(.*)$ http://www.pcspectra.com/$1 [L,R=301]
 
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,NC,L]
When I add the line Options -Indexes I get a 500 Internal Server Error, here is the dump from my log file:

Code: Select all

[Mon Nov 16 19:17:32 2009] [alert] [client 192.168.1.104] /var/www/sites/pcspectra.com/www/.htaccess: Option Indexes not allowed here
Is this because I have not allowed AllowOverride or whatever that option is in the main httpd.conf file?
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: Apache Options -Indexes

Post by VladSun »

Options directive
Syntax: Options [+|-]option [[+|-]option] ...
Context: server config, virtual host, directory, .htaccess
Override: Options
Status: core
So it's not because it's not in the httpd.conf.

Try "allowing" it.
http://httpd.apache.org/docs/2.0/mod/co ... owoverride
Indexes
Allow use of the directives controlling directory indexing
There are 10 types of people in this world, those who understand binary and those who don't
Post Reply