views:

39

answers:

1

Hi, I have a website admin area I want to protect with a password..

so inside the admin folder I put an .htaccess and .htpasswd files containing this:

.htaccess:

AuthUserFile C:/wamp/www/website_project/admin/.htpasswd
AuthName "Restricted Area"
AuthType Basic
Require valid-user

.htpasswd: (generated using an online tool)

admin:sOSDxAdJI4xx2

When I go to the admin folder, a popup is shown where I need to insert username and password... so until now its working fine, BUT no matter if I insert a correct password or not I get the same popup again when I hit 'enter', I can never access the folder...

Any suggestions?

+1  A: 

Based on the AuthUserFile line, it looks like you're using Apache on Windows, which has a different default password encryption algorithm than other platforms. Try using the htpasswd command-line tool to generate the password and see if you still have the same problem.

Curt