Published on: September 24, 2009 by George K.
To password protect a directory htaccess password protect rules can be added in the directory
AuthName "This is Hasten secret area"
To create .htpasswd file use the following command
htpasswd -c .htpasswd <user>
You will be prompted for password . Once it is done, the file will be created.
Now the directory is password protected.
The restrictions imposed on a parent directory will be applicable to the subdirectory too. To override this we need to specify it in .htaccess in the subdirectory. To disable password proptection on subdirectory , add the following in .htaccess
Allow from all
Category : Apache, cPanel, General, Howtos, Linux