Posted by: uttamkumar | December 27, 2007

Authentication using .htaccess

The folder or the page on the sever can be prevented from the unauthenticated user using .htacess and .htpasswd files.

The .htaccess will look like this.

AuthName “Restricted Area”
AuthType Basic
AuthUserFile /path/of/your/folder/to/be/protected/.htpasswd
AuthGroupFile /dev/null
require valid-user

you should keep .htpasswd and .htaccess file under the directory/parent folder of the file  which you want to protect from the unauthorized users.

.htpasswd file will contain username and password in the following format.

userName:password


Responses

  1. [...] Authentication [...]


Leave a response

Your response:

Categories