Monday, December 15, 2008

Block Access To Directories


I wanted to address how to block access to directories or folder access on your site. Lets say you have images in a folder named images. You do not want others to be able to view the contents of that directory or folder. To block access to all directories on a site merely copy the code below and add it to your .htaccess file.

Options -Indexes

To double check if it works, merely type into your browser an open directory, take the images folder for example, the url you need to plugin assuming images was a directory under the root, would be...

http://www.yourdomain.com/images

If you can see the contents of that folder, you did it wrong.

Im off to close up a few holes myself while we are talking about it.

Related Posts by Categories



2 comments:

Mark Hansen on December 16, 2008 at 6:34 AM said...

Hi Dave -

Good tip!

If you don't want to fiddle with the htaccess file, you can also just drop blank "index.html" files inside all your directories.

Anonymous said...

If i wanted to block all directories expect one, how would i go about that?

Followers

Twitter Updates

    follow me on Twitter
     

    Build A Niche Store Blog. Copyright 2008 All Rights Reserved Revolution Two Church theme by Brian Gardner Converted by Bloganol dot com Privacy Policy