Password Protection with .htaccess

It is very easy to password protect a .htaccess file in a folder or directory. This method is called .htaccess password protection, To protect with the password you need to use two files one is .htaccess and .htpasswd and save it into the folder or directory.
Now you need to add the following code in your .htaccess file.
1 2 3 4 |
AuthType Basic AuthName "Security Area" AuthUserFile /home/user/softaox/secure/.htpasswd Require valid-user |
Once you added the code don’t forget to change the path “/home/user/softaox/secure/.htpasswd” with the full path to your .htpasswd. Now you need to upload the .htpasswd file in some of the specific folder which only contains the username and password.
Following code for .htpasswd.
1 |
softaox:9476nIHW7Esgw |
Here “softaox” allows the user to access the password protected section with the password and here this is the password “9476nIHW7Esgw” to access the file.
awscloud serverHostingsecurityserver
Mraj
Creative Designer & Developer specialist by the spirit and a loving blogger by thoughts. If you have any questions let me drop an email with the article name to the following email id: [email protected]