Hi,
I had httpd running in my FC5. I guess directory listing is enabled by default (if no index.html, then I can see all the files inside). I have directory /var/www/html/links where I am currently working on. I have tried the ".htaccess" file methods mentioned in web to prevent directory listing but I can still see all the files when I go to this URL (simulating no index file).
My .htaccess file contains ================================= Options -Indexes (suggestion from one site) IndexIgnore * (suggestion from another site) =================================
Can somebody guide me how to fix this? I guess it will just be small tweak.
Thanks
On Sun, 2006-11-05 at 00:32 +0800, Deepak Shrestha wrote:
Hi,
I had httpd running in my FC5. I guess directory listing is enabled by default (if no index.html, then I can see all the files inside). I have directory /var/www/html/links where I am currently working on. I have tried the ".htaccess" file methods mentioned in web to prevent directory listing but I can still see all the files when I go to this URL (simulating no index file).
My .htaccess file contains
Options -Indexes (suggestion from one site) IndexIgnore * (suggestion from another site) =================================
Can somebody guide me how to fix this? I guess it will just be small tweak.
Thanks
<IfModule dir_module> DirectoryIndex index.html index.shtml index.pl index.cgi index.php </IfModule>
Option -Indexes turns off the index'ing if there is no file present as defined in DirectoryIndex above.
<Directory "/var/www/html">
Options -Indexes
AllowOverride None Order allow,deny Allow from all
</Directory>
On Sat, 2006-11-04 at 10:58 -0600, wrote:
I had httpd running in my FC5. I guess directory listing is enabled by default (if no index.html, then I can see all the files inside). I have directory /var/www/html/links where I am currently working on. I have tried the ".htaccess" file methods mentioned in web to prevent directory listing but I can still see all the files when I go to this URL (simulating no index file).
Erich Carlson
Option -Indexes turns off the index'ing if there is no file present as defined in DirectoryIndex above.
<Directory "/var/www/html">
Options -Indexes
AllowOverride None Order allow,deny Allow from all
</Directory>
And "AllowOverride None" stops .htaccess files from overriding settings in the configuration file. Read about the AllowOverride directive for its options.
On Sun, 2006-11-05 at 15:29 +0800, Deepak Shrestha wrote:
originally I had Options Indexes in my httpd.conf Now changed it to Options -Indexes and all went well. I erased the .htaccess files and it still works :-)
That is a better way to do things, usually (in the configuration file). The manual goes into details as to why, if you really want to know. You certainly don't need to do it both ways.