Hide directory tree (index) in Apache2

Tiempo de lectura: < 1 minuto

Reading Time: < 1 minute

Yes, we have folders to organize our code in the www directory and we don’t want them to appear when accessed through the browser.

All you need to do is create a .htaccess file and add the following line:

Options -Indexes

If the change is not applied, you need to restart apache2:

sudo /etc/init.d/apache2 restart

Reading Time: < 1 minute

Yes, we have folders to organize our code in the www directory and we don’t want them to appear when accessed through the browser.

All you need to do is create a .htaccess file and add the following line:

Options -Indexes

If the change is not applied, you need to restart apache2:

sudo /etc/init.d/apache2 restart

Leave a Comment