Disable directory access

I want to disable directory access for my entire website… this is usually done by making a change in apache’s httpd.conf. How do I do it for my website hosted on DH?

Thanks in advance.

You’ll have to block access through placing index files in the directories, and or .htaccess password/hotlinking.

Unfortunatly you can’t edit the httpd conf here.

art.googlies.net - personal website

Thanks for replying.

Is there no option besides manually placing index/error files in every single folder? I have close to 100 folders in a nested structure…and this could be quite cumbersome to maintain. Doesn’t sound like the best thing to do. I wouldn’t want to password protect each and every folder either. All I need is a standard forbidden error msg to show up if the user tries to access a directory directly. Is there any simpler option?

Thanks again.

Put the following line in an .htaccess file in the root directory of your site:

Options -Indexes This will be inherited by all subdirectories.

If you want to go back and enable directory listing for one particular subdirectory, put another .htaccess file there with the same line, but change the “-” to a plus sign.

If you want useful replies, ask smart questions.

I think that adding this in your root .htaccess will take care of this:

Options All -Indexes


Worked like a charm. Thanks a bunch guys.