I created an .htaccess file with only the following line:
Options -Indexes
However, the index is still shown for the directory.<
As there's no httpd.conf
file anymore, what you need to do on a VPS is:
/etc/apache2/sites-enabled/
ls
to find the file for the website you're looking fornano THE_CONF_FILE
or with whatever editor you'd likeAllowOverride None
values that you see in different <Directory> ... </Directory>
s to AllowOverride All
Save the file and close it
Now you need to enable module rewrite by running the command:sudo a2enmod rewrite
service apache2 restart
It'll work like a charm now!
In case you have
AllowOverride None
Change that to:
AllowOverride All
in your httpd.conf or in your default virtualhost file in in /etc/apache2/sites-available/...conf