0

I am trying to disable the Auto index of directories in the apache config.

<VirtualHost *:80>
    ServerName example.com
    ServerAlias www.example.com example.co.uk www.example.co.uk
    DocumentRoot /var/www/sites/example.com/public
    ErrorLog /var/log/httpd/error.log
    CustomLog /var/log/httpd/access.log combined
    Options -Indexes
</VirtualHost>

Will putting Options -Indexes into the VirtualHost configuration disable autoindex in these directories?

pkhamre
  • 5,900
  • 3
  • 15
  • 27
Alex
  • 209
  • 5
  • 12

1 Answers1

3

Yes, by putting in Options -Indexes you disable autoindex for the entire VirtualHost.

You can read about it in the Apache Core Features documentation if you would like to learn more about it.

pkhamre
  • 5,900
  • 3
  • 15
  • 27