Previous suggestions about putting a blank index.html in each directory that you do *NOT* want a directory listing to be generated in will work.
But, are you sure your web host's webserver config allows access to those directories other than cgi-bin?
I just looked in my apache httpd.conf file, and if I interpret this correctly it explains that the default setting of
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
for the root '/' directory, restricts access to that directory and all directories below, unless overridden by definitions for specific subdirectories(under '/'). So since this 'Directory /' definition(this is the default on my machine) doesn't specify 'Indexes', then no directory index listings will be generated for any directory unless expressly enabled by an 'Option Indexes' in a 'Directory' definition entered into the httpd.conf file.
So looks to me like you may(?) already be protected by your web host's webserver config. But if not, then either
1. put a blank index.html in each directory you want to
protect(against directory listing),
OR
2. assuming the webserver config is configured for it,
you can also put a .htaccess file in each directory
you want to protect.
HTH. |