2008
10.28

If you want to prevent users from browsing certain directories on your website you can use the powerful .htaccess  file (Apache only). With the .htaccess file you are able to override some default settings like allowing / denying users to browse through directories. This is very useful when you use a certain directory to save for instance: templates, pictures, files or similar things (e.g. http://www.yourdomain.com/files).

How to prevent users from browsing through directories…

  1. Create a new file (txt) and rename it to .htaccess
  2. Insert the following string into your new .htaccess file:
    1
    2
    3
    
    # DENY CLIENTS TO BROWSE THE CURRENT AND ALL SUB DIRECTORIES
     
    Options All -Indexes
  3. Upload this file into the directory which shall be not allowed to browse.

Thats it!

So long,
Andreas Glaser (aka JaZz)

1 comment so far

Add Your Comment
  1. This will affect robots from browsing directories with forbiten acces if i don`t have any index ?

    Thanks

*