Welcome to WebmasterWorld Guest from 23.20.96.7

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)

New User

5+ Year Member

joined:Feb 16, 2009
posts:31
votes: 0


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)

Senior Member

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

joined:Mar 31, 2002
posts:25430
votes: 0


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.

Jim

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

New User

5+ Year Member

joined:Feb 16, 2009
posts:31
votes: 0


Thank you very much... yet again!