apache directory browsing

How do i prevent clients from browsing directory structures if there is no index.html in a directory?

For example, lets say that i dynamically create directories on in my doc root of an apache based web server. I know if i type the url and there is no index or default page in there, then apache will allow the browser to see all the files in that directory. I don't want this, I'd rather force a redirect or a 404 or anything but letting them see my document.

Any ideas?

System:
FreeBSD 5.2.1 64-Bit
www: apache 2

hi
I could not understand you exactly. But I have some suggestion, hope helps.....
1 ) change the mode of your diresctory to 700 or 600 something that does not allow "other" user to see your directory content. This will show a "Forbidden" message on the browser screen. But, by the way you cannot list directory content even your docs!

2 ) edit your httpd.conf file (it must be under /usr/local/apache/con in FreeBSD, I am not sure!) and find the lines below

<IfModule mod_dir.c>
DirectoryIndex index.php index.html index.htm
</IfModule>

I your documents are in HTML or TXT format add the name of your file to the list and restart your server.

<IfModule mod_dir.c>
DirectoryIndex index.php index.html index.htm my_doc.html
</IfModule>

something/apache/bin/apachectl restart

Now, your browser assumes that "my_doc.html" is an index page.

Bye...