Web Hosting Talk







View Full Version : Help with .htaccess


JoeB
02-15-2001, 01:56 PM
What do i need to put in my .htaccess file so the files of a directory are not listed when there is no index.html file.

Thanks

jtan15
02-15-2001, 05:07 PM
You'll need to put this in the .htaccess file:

Options -Indexes

If this doesn't work, you'll need to insert this code into httpd.conf:

<Directory /path/to/directory>
AllowOverride Indexes
</Directory>

Hope this helps! :)

JoeB
02-19-2001, 01:42 PM
Thanks! Worked like a charm.

jtan15
02-19-2001, 05:02 PM
No problem, Joe. :)

Pingu
02-19-2001, 05:29 PM
Should this be done for every single directory, or is there a way to make this, umm, default...

jtan15
02-19-2001, 05:37 PM
Pingu,

In your httpd.conf file, you can insert this line:

Options -Indexes

But chances are you already have an "Options" line. So find that line in the config file and put a hyphen infront of Indexes. Or you can just delete Indexes from the list. :)

sodapopinski
02-20-2001, 01:36 AM
Originally posted by Pingu
Should this be done for every single directory, or is there a way to make this, umm, default...

Yes, if you put that .htaccess file into your main public html dir (for example: /home/yourname/htdocs), it will affect every single dir.