PDA

View Full Version : protect directory listing


kheops
8th of October 2006 (Sun), 06:30
hi,

thanks to this thread http://photography-on-the.net/forum/showthread.php?t=224990 Tommy showed me that something can be wrong in our galeries

let's say i take a random link of a picture on his site
http://photo.klein-jensen.dk/eephotos/normal/XXXXXXzoo_croc01.jpg (http://photo.klein-jensen.dk/eephotos/normal/050818zoo_croc01.jpg)

if i try to browse the
http://photo.klein-jensen.dk/eephotos/normal folder i get a 403 error, same thing for http://photo.klein-jensen.dk/eephotos

on my site directory listing (ftp style) and browsing was possible, making users preferences pretty useless

so i've added an .htaccess file in this normal folder with

############
Options -Indexes
ErrorDocument 403 http://www.littleearthquakes.net/ee/
############

and all is good now

i think it could be a good advice to tell users to add this kind of file in each of their "sizes folders" (small, normal, big, huge....)

does it makes sense ?

tommykjensen
8th of October 2006 (Sun), 06:36
I think this is webserver setup. I have not done anything special to disallow browsing my folders.

Pekka
8th of October 2006 (Sun), 07:42
Yes it is a web server setup option to deny directory listings, that should always be on. I have also planned for EE a check and upload of index.php and index.html files to image paths in case directory listings are on.

kheops
8th of October 2006 (Sun), 08:47
Thanks Pekka, will be useful for "security" reasons :)