Password Protect Folder with Apache .htaccess file

Create new file named “.htaccess” in the folder with this Content

AuthName "Password Protected!"
AuthType Basic
AuthUserFile /home/cpanel_user_name/public_html/folder_name/.htpasswd
require valid-user

*Change cpanel_user_name & folder_name

Create new file named “.htpasswd” in the same folder with this Content (Username:Password)

asiq:12345

Leave a Reply

Your email address will not be published. Required fields are marked *