Cant get my .htaccess password protection to work.

Discussion in 'Apache' started by anthonyneiger, Feb 1, 2010.

  1. #1
    Hello all, I've posted this question on several forums already and noone has offered their help, hopefully someone here can. I am trying to password protect a directory on my site using .htaccess the script is as follows:

    AuthName "Restricted Area"
    AuthType Basic
    AuthUserFile /Direct Download Area/.htpasswd
    AuthGroupFile /dev/null
    require valid-user

    From everything I'm seeing the script is correct but whenever I click the link on my homepage to get to that directories main page it just links me over to it. No prompt for a password or anything. My site is hosted on godaddy but they told me that they do support .htaccess files and password protection protocols. What I am trying to do is setup a direct download area for purchasers of my product to allow for easy access and downloading. If you need to see the site itself it is www.how-to-buy-a-car-cheap.com. I thank you for your help in advance.
     
    anthonyneiger, Feb 1, 2010 IP
  2. RHS-Chris

    RHS-Chris Well-Known Member

    Messages:
    1,007
    Likes Received:
    35
    Best Answers:
    10
    Trophy Points:
    150
    #2
    This does not look right:

    /Direct Download Area/.htpasswd

    You are pointing at a direct path, which means that file is located outside of your accessible directory. It should look something like this, with your correct information of course:

    /home/username/public_html/Direct Download Area/.htpasswd

    If possible as well, check your error logs to see what is getting flagged, especially if the above suggestion does not work.

    Chris
     
    RHS-Chris, Feb 1, 2010 IP
  3. anthonyneiger

    anthonyneiger Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    The absolute path to my site is showing as D:\Hosting\5032300\html . So I can be sure that I am understanding you correctly should I have it as D:\Hosting\5032300\html\Direct Download Area\.htpasswd ?
     
    anthonyneiger, Feb 1, 2010 IP
  4. RHS-Chris

    RHS-Chris Well-Known Member

    Messages:
    1,007
    Likes Received:
    35
    Best Answers:
    10
    Trophy Points:
    150
    #4
    That sounds right, if the path is correct. Have you tried it yet?
     
    RHS-Chris, Feb 1, 2010 IP
  5. anthonyneiger

    anthonyneiger Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Yeah, I tried it, still no prompt for a password. I also tried this other format that I found searching around the net;
    AuthUserFile /home/content/J/O/H/johndoe/html/member/.htpasswd
    where J O H is replaced with the first three letters of my username and johndoe is replaced with my username, and that also did not work, big surprise, hahaha.

    Do you think since I am hosted on godaddy there would be a permission or setting that I have to adjust? Just a guess, I've been playing around in the permissions and settings trying to find something that looks right but haven't had any luck. You were talking about an error log to look at, any idea where to find that? Thanks for your help.
     
    anthonyneiger, Feb 1, 2010 IP
  6. RHS-Chris

    RHS-Chris Well-Known Member

    Messages:
    1,007
    Likes Received:
    35
    Best Answers:
    10
    Trophy Points:
    150
    #6
    Are you on a windows server with them? Which control panel do you use as well?
     
    RHS-Chris, Feb 1, 2010 IP
  7. anthonyneiger

    anthonyneiger Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    I am on the windows server, I'm assuming that is why I have a different absolute path. Not sure what you mean by control panel, I'm just logging into my account and going to the hosting section where I click on the manage link and I've been playing around in there trying to get something to work. I really appreciate your help.
     
    anthonyneiger, Feb 2, 2010 IP
  8. country

    country Peon

    Messages:
    26
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    You should put .htaccess and .htpasswd on root folder bro. PM me if you need i help.
     
    country, Feb 2, 2010 IP
  9. brenda_pdx

    brenda_pdx Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    I thought this question might work in this thread.

    I set-up htaccess manually on a Web site but users complained that they were prompted to use username and password twice in order to authenticate. They did get in however after entering the u and p the second time. Since I host with GoDaddy (Apache), and after disabling what I set up for htaccess I tried using the password protection through their control panel, it was resolved for some people. Has anyone encountered the problem? and was it solved?

    Second, I have one user who cannot get in at all. I've used the username and password from my computer and it authenticates. Two other people have tested it as well and can get in. Her computer has also been remotely accessed and the user who can get in with her account info on his machine, cannot get in to the Web site on hers. We've cleared the browser cache. Anyone has an idea?

    Thanks in advance.

    Brenda
     
    brenda_pdx, Feb 5, 2010 IP