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

Author: Nabin Nepal (Starx)

Hello, I am Nabin Nepal and you can call me Starx. This is my blog where write about my life and my involvements. I am a Software Developer, A Cyclist and a Realist. I hope you will find my blog interesting. Follow me on Google+

...

Please fill the form - I will response as fast as I can!