.htaccess Password

.htaccess Password

Use this codes needed to password protect a directory or selects files within it on your site via .htaccess. It encrypts the desired passwords, then outputs the corresponding codes to put inside your .htaccess and .htpasswd files.

Step 1:
——-
Insert the below code into your .htaccess file, and upload this file to the directory you wish to protect

.htaccess:

AuthName “Restricted Area”
AuthType Basic
AuthUserFile D:\\prem/.htpasswd
AuthGroupFile /dev/null
require valid-user

Step 2:
——-
Save the below code into a file called .htpasswd, and upload this file to the location as specified in the “AuthUserFile” line above.

.htpasswd:

prem:MZUlyyu4QCy62
vijay:rJhpK4irpEtEw

Leave a Reply


All material @ copyrighted by chrisranjana.com. If you want to link to this article you are welcome to do so. Unauthorized publication is strictly prohibited. This developer tutorial website contains articles by Php programmers , Software developers, Mysql programmers and asp c# programmers. This website also contains ajax tutorials and advanced mysql sql stored procedures and functions tutorials and sample codes.