Hi guys so recently I have been trying to make my website password protected for a client and have been trying to get my .htaccess and .htpasswd files working but it just doesn't seem to be happening for me. My problem is that whenever I enter the correct login it then immediately returns to me saying that i have not entered the correct password. I am pretty sure that the pathname is correct as it is in the root folder with my index page. here is my code: AuthUserFile /root/.htpasswd AuthGroupFile /dev/null AuthName EnterPassword AuthType Basic Require valid-user although this doesn't seem to work. I have tried taking the root out and just having /.htpasswd as the pathname but no luck there either. Any suggestions?
You should use an absolute path for AuthUserFile which is something like /home/youruser/public_html/yoursite.com/root/.htpasswd It is not relative to the root of your domain folder but the entire file system.