April 18, 2011
Restricting access to a web directory using .htaccess
Question by Sanks Raut
I want to restrict access to certain web directories in my website using .htaccess file. I know one way using
order allow,deny
deny from all
But it restricts only the first directory. It doesn’t work for the remaining ones. Please help
Answer by jimy
Options -Indexes
add this line at the top of the .htaccess file
Answer by Starx
You are wrong, using deny from all
also applies to subdirectories.
i.e. unless there is another .htaccess
inside the other sub directories that allows the access