缺少401的“WWW-Authenticate”标题

时间:2012-10-31 19:53:13

标签: apache .htaccess .htpasswd

我有一个受.htaccess中的std AuthUserFile-directive保护的项目。

一切都很简单,在另一台服务器上已经很好了。以下是我.htaccess的内容:

.htaccess

AuthName "Adminbereich"
AuthType Basic
AuthUserFile /srv/www/passwords/.htpasswd-office

<Files *.php>
require valid-user
</Files>

访问.htpasswd-office。如果我致电http://user:pass@host/,我就会进去。如果我只是致电http://host/,我会立即收到此消息...

Authorization Required

This server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required.

...没有任何登录框显示。可能是什么原因造成的?

这是一个示例标题:http://www.pagetutor.com/keeper/mystash/secretstuff.html

HTTP/1.1 401 Authorization Required
Date: Thu, 01 Nov 2012 21:38:27 GMT
Server: Apache/2.2.22 (Unix) mod_ssl/2.2.22 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4
WWW-Authenticate: Basic realm="My Secret Area"
Accept-Ranges: bytes
Content-Length: 343
Content-Type: text/html

这是我的标题:

HTTP/1.1 401 Authorization Required
Date: Thu, 01 Nov 2012 21:36:41 GMT
Server: Apache/2.2.20 (Ubuntu)
Vary: Accept-Encoding
Content-Type: text/html; charset=iso-8859-1

缺少魔法WWW-Authenticate: Basic realm="...",我不知道为什么......

我使用标准的ubuntu(11.10)apache(2.2.20)而没有任何修改......

0 个答案:

没有答案