当用户尝试访问他们无权访问的资源时,我的服务器返回403禁止错误。除了头部,服务器还会写一条描述错误的小消息。
在Firefox中,错误消息很好地显示,用户知道发生了什么。
在Internet Explorer中,消息被隐藏并替换为403 Forbidden标准错误页面。
是否有任何特定规则允许我在所有浏览器中显示错误消息,同时仍将状态设置为403 Forbidden?
以下是此状态的RFC信息:
The server understood the request, but
is refusing to fulfill it.
Authorization will not help and the
request SHOULD NOT be repeated. If the
request method was not HEAD and the
server wishes to make public why the
request has not been fulfilled, it
SHOULD describe the reason for the
refusal in the entity. If the server
does not wish to make this information
available to the client, the status
code 404 (Not Found) can be used
instead.
好像我应该设置一条消息,但IE不会显示它。