Tag: .htaccess
.htaccess - How to restrict browsing through directories
by Andreas Glaser on Oct.28, 2008, under Computer, Development
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…
- Create a new file (txt) and rename it to .htaccess
- 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
- Upload this file into the directory which shall be not allowed to browse.
Thats it!
So long,
Andreas Glaser (aka JaZz)