I have localhost/mySite/logs as password protected and it works using .htaccess and .htpasswd, but additionally I would like to have localhost/mySite to not list directory contents. I've tried doing this in /etc/apache2/apache2/apache2.conf:
<Directory "/www/var/mySite">
Options -Indexes
</Directory>
Currently I have this in /etc/apache2/sites-available/default:
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
I can get around this by putting a blank index.html in /var/www/mySite but what is the other way using Options -Indexes? (I got from some where else that by default all files under /var/www ignore the .htaccess file so I changed the AllowOverride None to All in /etc/apache2/sites-available/default)
Tell me more
×
Ask Ubuntu is a question and answer site for
Ubuntu users and developers. It's 100% free, no registration required.
|
|
|||
|
|
|
My dirty solution is to create an empty index.html file in each such directory. |
|||
|
|
In /etc/apache2/sites-available/default, somewhere there you will hit:
remove Indexes and I think you solved your problem. |
|||||
|