How to prevent directory listing of your website

(1)create a .htaccess file at your root directory
(2)add following code in this file

IndexIgnore *