Question: What is “directory listing” and how do I enable/disable it?
Answer: On an Apache HTTP Server, directory listing refers to a directory on the server that does not have a default index file. The file is usually called index.html, index.htm, index.php, etc. That is the default page that visitors will see when they go to a directory on your website, such as www.yourdomain.you/directory.
If there is no index file, Apache can do one of two things: 1. display an error, forbidding the visitor from seeing the contents of the directory or 2. display a list of the directory contents. Your web hosting provider determines the default setting for directory listing, but you can control it in each directory using an .htaccess file.
Create a new file called .htaccess or open your current one in the directory you want to configure. Then simply add this line to disable directory listing:
or this line to enable it: