PDA

View Full Version : How to turn off directory browsing?


nyoung
12-30-2000, 01:17 PM
I was curious to know how do I turn off directory browsing for my site. I know the default document is index.html,index.php. If I create a new directory, let's say "images", and this new directory doesn't have the default document inside, it allows the user to browse the contents of that directory. I would like to disable this. Any help on how to accomplish this would be greatly appreciated. Thanks in advance.

-nyoung

Jeff
12-30-2000, 01:34 PM
I've never heard of turning off directory browsing, but you can put a blank file called index.html in the directory and then visitors wont see all the files.

gnorthey
12-30-2000, 02:04 PM
There is a post on using the .htaccess file somewhere the inteh message baord, I don't know if it covers the specifics of cutting off directory browsing, but I do know that .htaccess would be the file to use.

ebsuc
12-30-2000, 02:22 PM
Do you have a .htaccess file in your main directory (www) with "indexes" listed as one of the options?

Options blah Indexes blah

I am using the old control panel and don't have this enabled, perhaps indexes is enabled by default on the new panel?

Maybe you could create a .htaccess in your main directory and add:

Options -Indexes

Hope it works.. You can also put the .htaccess in the sub-directory if you wish.

nyoung
12-30-2000, 05:02 PM
Thanks for all of the replies.

I created a .htaccess file in my root directory with the switch below:

Options -Indexes

This would generate a 404 if the default document isn't in the directory

-nyoung