Hide directory contents from showing when accessing the URL directly

Posted by SoLoGHoST on Server Fault See other posts from Server Fault or by SoLoGHoST
Published on 2011-02-26T17:07:25Z Indexed on 2011/02/26 23:26 UTC
Read the original article Hit count: 218

Filed under:
|
|

On my site, if you browse to http://example.com/images/ the contents of the entire directory are shown like so:

Need to prevent this from showing

How can I make it so that this doesn't show up when people browse directly to http://example.com/images/?

Can I create an .htaccess file in that directory? Or is there a better way? I really don't want people being able to do this for the entire site (i.e. every directory on that site).

What can I do to prevent this? I figure it's either something that has to be done in Apache or using an global .htaccess file and placing it in the public_html folder perhaps?

EDIT

I diverted this using an index.php file, but I still feel that security is an issue here, how can I fix this permanently?

© Server Fault or respective owner

Related posts about apache

Related posts about .htaccess