Created
November 1, 2012 12:48
-
-
Save biswarupadhikari/3993445 to your computer and use it in GitHub Desktop.
How to Password Protect Directory Usiing .htaccess file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AuthName "Secure Area" | |
AuthType Basic | |
AuthUserFile /home/adidac/.htpasswd | |
require valid-user |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user1:$apr1$VbiZFY..$oMHWe5aNzsSZY.82QY8hp1 | |
user2:$apr1$BzCdmMtk$X3a.Qrsa4T7M.YPcfUvCt0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Step 1 : Create htaccess file under the directory which u want to protect. | |
AuthName "Secure Area" | |
AuthType Basic | |
AuthUserFile /home/adidac/.htpasswd | |
require valid-user | |
Step 2 : Generate Username Password Pair | |
Open Terminal : $ htpasswd -nb user1 123456 | |
OutPut Will Be : $ user1:$apr1$VbiZFY..$oMHWe5aNzsSZY.82QY8hp1 | |
Step 3 : Create htpasswd file Database | |
create file let .htpasswd | |
generated string in terminal (user1:$apr1$VbiZFY..$oMHWe5aNzsSZY.82QY8hp1) | |
NB: If you need Multiple User Add In Multiple Line | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment