How to disable viewing of sub-folders on the web


#1

Hello.

I am curious if I can “lock” all sub-folders of a my url. If someone views my url in a browser, they obviously are directed to the index file which displays my site, but if they enter my url + a sub-directory, they are able to view the directories contents.

Is there a way to disable that, so as to keep data in any sub-folder protected from being viable straight in a browser?

Thanks,
–EthanG


#2

Put the following text in an .htaccess file at the root of your domain:


#3

Andrew! Thanks for getting back to me.

I did a google search about the .htaccess and found this page:
http://blog.dreamhosters.com/kbase/index.cgi?area=801

It worked just as I had planned.

Thanks again,
–EthanG


#4

Wow, that page is really old. Use this version instead: http://wiki.dreamhost.com/Password-protecting_directories


#5

Cool, thanks for the updated link, but I am just going to use the control panel to protect these domains, for the time being. I don’t want to get involved with the access files just yet.

Thanks again!