.htaccess passwords

Discussion in 'Site & Server Administration' started by emforce, Aug 5, 2010.

  1. #1
    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?
     
    emforce, Aug 5, 2010 IP
  2. TheDataPlanet.com

    TheDataPlanet.com Well-Known Member

    Messages:
    503
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    108
    #2
    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.
     
    TheDataPlanet.com, Oct 3, 2010 IP