Go to folder were you want to create .htaccess
1. vim .htaccess
Type
AuthName " This is Restricted"
AuthType Basic
AuthUserFile /etc/httpd/.htpasswd
require user username
Creating htpasswd
htpasswd -mc /etc/httpd/.htpasswd username
Newpasswd:*****
2 comments:
require Valid-user -> this would be wrong buddy.bcos u are creating all users in a single .htaccess file and when asked for username and password if we give any of the user name and password it will work .
so its should be like this
require user newslet
username for tht particular folder
thx pradeep for mentioning the mistake i have changed it
Post a Comment