htaccess Password Protect Folder
If you want to protect you directory using htaccess than follow this post.
Protecting files on your website from unauthorized users can be very important. Even more important is the method by which you accomplish this task. You can use PHP to listen for login authorization information on each page, but that doesn't protect your images, documents, and other media. That's why .htaccess method of protecting files and directories the most reliable.
Step1: Creat one .htaccess file as following
AuthName "Authorisation Required" AuthUserFile "/home/test/public_html/getfile/.htpasswd" AuthType Basic require valid-user ErrorDocument 401 "Authorisation Required"
Step2: Creat one .htpasswd file as following
username:encryptedpassword
The .htpasswd file contains the usernames and passwords of allowed users. One per line. The passwords are MD5'd for security purposes.
e.g. dave:XO5UAT7ceqPvc
That's it.
Please support us, Like us on Facebook.
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment