0

I am trying to stop directory indexing for a specific directory in Apache (Ubuntu) and have put the following in my .htaccess file:

<Directory /var/www/xyz>
    Options -Indexes
</Directory> 

This blocks the whole site. Why?

2 Answers 2

3

Because Options -Indexes in .htaccess is recursive, is equivalent to

<Directory /your/root/>
    Options -Indexes
</Directory>

If you want to disable index only for a specific directory without recursion just put an empty index.html file there and ensure that DirectoryIndex directive is set to index.html.

0

And you put the .htaccess file in the directory which you want to disable?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .