The pertinent part of my .htaccess looks like this:
Options -Indexes
Order allow,deny
Deny from all
Re
A better and simple way is as follow :
1 - Insert in your main conf (ie Outside VHOST world) :
RedirectMatch 404 ^/myDirectory(?|\/)$
with myDirectory = css, js, images ...
2 - You can set a per directory -Indexes as follow :
Allow your "DirectoryIndex" Apache directive content to be served :
Options Indexes
AllowOverride None
Order Allow, Deny
Allow from all
and Deny directory index for others :
Options -Indexes
AllowOverride None
Order Allow, Deny
Allow from all
with myDirectory = *, css, images, js, secret, ... following your needs.