PDA

View Full Version : I don't want folder index to show up in browser


marcusp
07-29-2001, 09:50 PM
When you go to one of the directories in my domain, like www.domain.com/images you get an index of everything that is in that directory. How do I change the file permissions to still allow use of images but to not allow the index to show up. Is there some other way of doing this without file permissions?

Thanks in advance,
Marcus

Bob
07-29-2001, 09:55 PM
Hi Marcus,

IMHO the easiest way would be to place a custom 404 file in the folder in question and name it index.html.

Then when they access the folder that's what they will get and not an index listing of the contents of the folder.

Hope this helps, :)
Bob

marcusp
07-29-2001, 10:32 PM
That did it, thanks for the quick reply. I always prefer the easy route myself. Of course as soon as I read your post I thought why didn't I think of that, but such is life.

Thanks again.
Marcus

robpitt
07-30-2001, 10:14 AM
Another option is to edit/create a .htaccess access file in the directory you want to protect. Then make sure the .htaccess file has the following line in it:

Options -Indexes

This will overide the default automatic generation of a directory index when no index file is found. Note this settings will apply to the directory and all subdirectories.

Rob