.htaccess internal server error while trying to password protect a directory

Hi,

While trying to password protect a directory with .htaccess, I am receiving “Internal server error”.

The browser asks me for login username and password, and after I enter correct details, it shows me this “Internal server error” error.

If there was some issue with .htaccess or .htpasswd files, then popup box for entering username and password should not get visible.

I wonder what might be the issue on my new server.


authtype basic
authuserfile /var/www/vhosts/abc.com/httpdocs/admin/.htpasswd
authname "Secure Area"
require user admin

Both .htaccess and .htpasswd files are in the same folder.

Moreover if I include this line in .htaccess file, it shows internal server error WITHOUT asking me any username or password.

authgroupfile /dev/null

Please suggest.

I also got this error a while back and the problem for me was that the 401 file Apache was linked to didn’t exist.

To test this create an empty file called 401.html in your web root and put


ErrorDocument 401 /401.html

at the top of your .htaccess

If that solves the problem you can amend 401.html with the message you’d like people to see if they don’t correctly log in.

For errors check the error.log of your website.

jv,

I’d take a close examination of http://www.euronet.nl/~arnow/htpasswd/documentation.html and change your require statement.

Regards,

DK