On many web servers, directory listing is disabled by default. The idea is that if you don’t have an index file in a directory a 403 HTTP Forbidden Access error will be return. The client will not be able to see the files in the directory. Anyway, some users want to be able to list the files in a specific directory.
To enable directory listing:
- Navigate(via a file manager or FTP/SSH client) to the directory you want to enable directory listing for
- Create/edit the .htaccess file
- Add the following line on the top of the file:
Options +Indexes
To disable directory listing:
- Navigate(via a file manager or FTP/SSH client) to the directory you want to disable directory listing for
- Create/edit the .htaccess file
- Add the following line on the top of the file:
Options -Indexes
Resources:
Apache Module mod_autoindex