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?

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.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.