Page 1 of 1

Restricting access to directories that have no index

PostPosted: 09. January 2005 06:00
by Toby B.
Ok, here is what I am looking to do..

1.) prevent access to directories that have no index file (i.e. index.html or index.php). So that people cannot see the directories and are greeted with a "Access Denied"....

For example

Access granted to:
www.mysite.com/images/image01.jpg

But is the person tried to view:
www.mysite.com/images/
they would be unable to view the directory...


I would like to set this up so that is server wide, not per directory...

Make sense?

PostPosted: 09. January 2005 11:00
by Dave_L
In your Apache httpd.conf file, remove the Indexes attribute from the Options directive(s).

For example, change:
Code: Select all
Options Indexes FollowSymLinks MultiViews Includes ExecCGI

to:
Code: Select all
Options FollowSymLinks MultiViews Includes ExecCGI
.

Reference: http://httpd.apache.org/docs-2.0/mod/core.html#options

PostPosted: 09. January 2005 11:43
by Toby B.
Thanks for the speedy reply... :wink: