Example: prohibition and permission to issue a listing.


In some cases, it is required to display a list of files in the directory (directory listing) if there is no file in the directory that is shown by default. To do this, add the following line to .htaccess:


Options +Indexes

The .htaccess file must be created exactly in the directory in which you plan to allow listing. This directive will also apply to all subdirectories (this is achieved by the AllowOverride All directive enabled by default in the virtual host settings).


By default, the Options -Indexes directive is enabled, and if there is no index page, you will get HTTP error 403.