Forum Moderators: phranque

Message Too Old, No Replies

.htaccess help

I keep getting internal server errors

         

egcomm

1:27 am on Feb 16, 2005 (gmt 0)

10+ Year Member



Hello-

I am trying to password-protect a directory on a client's site. It's not working and my error log says "AuthName takes one argument, The authentication realm (e.g. "Members Only")".

My .htaccess file:
AuthUserFile /full/path/to/directory/.htpasswd
AuthName “Member Forms”
AuthType Basic

require valid-user

My .htpasswd file:
username: password

Any ideas about what's going wrong? Thanks.

coopster

2:27 am on Feb 16, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Have you made sure that "Member Forms" is in quotations after the AuthName directive? Those quotation marks look a bit suspect when pasted into the forum here. Without quotation marks the directive's value will be considered multiple values and you will receive errors. Also, what are you using to edit the file? Make sure that your editor is generating Unix newlines. Mac/Windows newlines might also give the one-argument warning.

jdMorgan

2:27 am on Feb 16, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Have you tried putting the AuthType first?

You also need AllowOverride AuthConfig (at a minimum) in order to use mod_auth.

Jim

egcomm

8:33 pm on Feb 16, 2005 (gmt 0)

10+ Year Member



Thanks for the help. It must have been the editor I was using. Now I can't seem to get it to read my .htpasswd file.

Back to trouble-shooting.

jdMorgan

9:05 pm on Feb 16, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Make sure your .htpasswd file was created using the utility on the server you are intending to use it on. Otherwise, the 'seed' used to encode the passwords will be incorrect.

Jim