Directory listing might be harmful to your site because others can browse and download all files in your directories. Preventing this problem is less than easy with 2 basic ways:
- Use blank index file: In most case, your web server will load the file named index.html in a directory by default when it’s called by the browser. So just upload a blank index.html to the directories which you don’t want to be listed. After that, your server will response a blank page instead of listing that directory when it’s called.
- Use .htaccess file: upload a file named .htaccess which contains only: Options -Indexes on your root directory. If you already have a .htaccess with other contents in it, simply edit and add 1 more row like above. All your directories are inaccessible from now on, a 403 page will be shown instead.
#1 by scoormedo on December 13, 2008 - 7:33 pm
Hi!
My name is Jessika!
#2 by Hieu Trung on December 13, 2008 - 11:19 pm
Hi, nice to know you.