I tried to implement htaccess password protection for a directory in my localhost.
My htaccess file is situated in
/home/Server/Dev. The directory I want to protect is
/Dev/. My .htaccess file has the following contents:-
AuthName "Restricted Area" AuthType Basic AuthUserFile /home/admin/.htpasswd AuthGroupFile /dev/null require valid-user
My .htpasswd file is situated in
/home/admin/.htpasswd and has the following content:-
But when I try accessing
http://localhost/Dev/, password is not asked and the url is directly accessible. Can anyone please point out what I'm doing wrong.