开发者

.htaccess and .htpasswd to prevent access to folder problem

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 admi开发者_如何学编程n 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?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜