Howto: Disable directory listing using .htaccess

If you want to preventing directory listing / prevent your server from displaying entire content of directory, here some tips :
1. Add an empty file named index.htm or index.html or index.php; this will show a blank page for the directory.
2. Add / edit your .htaccess file, and add this code
Options -Indexes
this will throw a 403 Fobidden HTTP respose. a – (minus) sign tells Apache to do not index / listing file in the current or sub directory.
3. For a specific file do not allow to list you can modify .htaccess file with this code
IndexIgnore *.zip *.jpg *.gif
This will hide all files with .zip , .jpg and .gif extension.
PS: this tips works on apache http server only.
Related posts:
emang kalo ga pake dimodif gitu, seluruh directory bisa kelihatan ya?
[Reply]
@joanne : iya bisa kliatan tuh.. orang2 jadi bisa browse file2 kita di web
thx for your visit ^_^
[Reply]