Welcome to WebmasterWorld Guest from

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Is this the best way to protect directory's contents from being listed



6:27 pm on Aug 3, 2009 (gmt 0)

5+ Year Member

What I'm using now is a line inside the htaccess file:

IndexIgnore *

This prevents people from viewing the listings of directory if it doesn't have an index file inside... which the "images" dir doesn't have for example. Yeah I know I can always add an index file, but it just seems artificial to me.


8:06 pm on Aug 3, 2009 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

You could use

Options -Indexes

to return a 403-Forbidden response to all directory requests unless that directory contains an index file.

This would prevent not only the files in the directory from being viewed, but also the directory itself.

I don't feel it's greatly better than what you've got, just a different method.



6:12 pm on Aug 5, 2009 (gmt 0)

5+ Year Member

Thank you very much... yet again!

Featured Threads

Hot Threads This Week

Hot Threads This Month