2

In htaccess I am blocking directory browsing by using the following code.

# directory browsing Options All -Indexes 

However, I want people to have access to a certain folder, let's say the folder is called pictures, so the folder is at mysite.com/pictures.

How do I give access to that folder/directory, but keep the rest blocked?

1 Answer 1

5

Put a .htaccess file into your pictures folder, with this line:

Options Indexes 

(or "+Indexes", which is the same.) That should take care of it because child .htaccess files override parents.

From your question it's not clear that you understand the limitations of "Options Indexes". This does not "block" access to a directory; it merely turns off an auto-generated directory listing. Knowing a filename, anyone can still access the resource whether Indexes are enabled or not.

Sign up to request clarification or add additional context in comments.

1 Comment

I am new to htaccess, but thank you for the clarification on how it works! I appreciate it

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.