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?
Put a .htaccess file into your pictures folder, with this line:
(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.