.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
