PDA

View Full Version : .htaccess not working



leaaa
07 May 2009, 01:59 PM
Hi,

I have followed a million guides all day and even though i am absolutely sure that i am doing this right, it wont work!

I am trying to password protect my assignments at the bottom of my website, which currently sit in a subfolder /assignment

My .htaccess file is as followed:

AuthName "restricted area"
AuthType Basic
AuthUserFile /var/www/vhosts/numyspace.co.uk/web_users/./home/~unn_t005763S/public_html/assignment/.htpasswd

require user docs

and my website is here website (http://www.numyspace.co.uk/~unn_t005763)

I wont show my password file.

I have used the AuthUserFile path as above as my lecturer said this is the correct one. I have also tried just /~unn_t005763S/public_html/assignment/.htpasswd but that doesnt work either.

The problem i am getting, is when i type in the user and password on the proected page and hit enter, a new form comes up asking me to enter it again!

Whys it doing that? It has correct permissions too.

I been working on this since 11am this morning and im losing patience :wall:

Alan
07 May 2009, 07:09 PM
Without looking at any sort of reference, I will say that two things could be wrong.

You are using the wrong absolute path to the .htpasswd file, or the passwords in the .htpasswd file are unreadable. :-) If you have direct access to a linux shell, use the htpasswd command to generate the proper user and password combination, if not use a free site on the web. I find that they sometimes don't work that way though.

Also change this:
/var/www/vhosts/numyspace.co.uk/web_users/./home/~unn_t005763S/public_html/assignment/.htpasswd

To this:
/var/www/vhosts/numyspace.co.uk/web_users/home/~unn_t005763S/public_html/assignment/.htpasswd