HTTP身份验证适用于Firefox,但不适用于Google Chrome

时间:2013-08-12 14:11:12

标签: php html .htaccess google-chrome

我有一个网站使用带有.htaccess的http身份验证 这项工作在Firefox中非常完美,但使用正确的密码却无法与Chrome配合使用。

.htaccess代码

AuthUserFile /web/posefauxcils/revuedigitale/htpasswd.txt
AuthName "Acces protege"
AuthType Basic
Require valid-user

htpasswd.txt中的密码用

加密
crypt($_POST['pass'], '4kp')

1 个答案:

答案 0 :(得分:1)

尝试将文件htpasswd.txt更改为.htpasswd

.htaccess应包含:

AuthName "Page d'administration protégée"
AuthType Basic
AuthUserFile "/home/site/www/admin/.htpasswd"
Require valid-user

然后在.htpasswd:

login:crypted_passord

要查看加密密码:

<?php echo crypt('yourpass'); ?>
相关问题