Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

From what I can read changing

Options All Indexes FollowSymLinks MultiViews 

to

Options All FollowSymLinks MultiViews

in httpd.conf should disable directory listing, but I can still list them.

I have only been able to disable this using .htaccess files.

Question

How do I disable directory listing in httpd.conf for DocumentRoot and all VirtualHost's?

share|improve this question

3 Answers 3

up vote 4 down vote accepted

No, it doesn't work like that, the All means enable all options except MultiViews, the order is also important. To disable directory listings you need -Indexes so

Options All FollowSymLinks MultiViews -Indexes 

would work but

Options -Indexes All FollowSymLinks MultiViews

wouldn't as the All after the -Indexes would re-enable it.

share|improve this answer

You should put this on your httpd.conf to disable indexes globally:

Options -Indexes

Then you should check all your virtual hosts to see if they have it explicitly enabled.

This blog post might be helpful to understand how directory listing works.

share|improve this answer

Remove All from the flags, as well. All sets every option to enabled, except for MultiViews.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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