1 Apr 2022

Disable Apache Web Directory Listing Using .htaccess File

Disable Apache directory listing using .htaccess

If you don't have administrator access to the system or want to manage directory listing on a per-directory basis easily, you can use the above Options -Indexes directive in .htaccess files.

  1. Open or create .htaccess file on the directory that you want to disable listing using your preferred text editor.
    $ sudo vi /var/www/mysite/.htaccess
  2. Add -Indexes to Options directive in the .htaccess file.
    Options -Indexes



https://www.simplified.guide/apache/disable-directory-listing

No comments:

Post a Comment