Disable Directory Browsing with .htaccess

If there is no default homepage, such as index.htm, index.html, index.php, and so on, all the documents and files will be listed. Hackers often use this to find backdoor for them to hack a web site.

If you are using a linux related web hosting, you can use .htaccess to disable directory browsing. Just add the following code at the beginning of .htaccess:

# Disable Directory Browsing
Options All -Indexes

There is another way, you can creat an empty homepage for this directoy, here are exmples codes:
<html>   <head>     <title></title>     <meta content=””>     <style></style>   </head>   <body></body> </html>

Just save the above code in index.html, or index.php, and put it into the directory.