在403 Forbidden错误浏览器行为 [英] Browser behavior on 403 Forbidden error

查看:376
本文介绍了在403 Forbidden错误浏览器行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当用户试图访问他们没有对资源的访问我的服务器返回一个403 Forbidden错误。随着首部服务器也写一个小的消息描述的错误。

My server returns a 403 forbidden error when a user tries to access a resource that they do not have access to. Along with the header the server also writes a small message describing the error.

在Firefox中的错误信息被很好地显示,并且用户知道发生了什么事。

In Firefox the error message gets displayed nicely and the user knows what's going on.

在Internet Explorer中的消息被隐藏,并与403禁止标准错误页替换。

In Internet Explorer the message is hidden and replaced with the 403 Forbidden standard error page.

有没有让我在所有浏览器显示错误信息,同时还在状态设置为403任何特定的规则禁止?

Are there any specific rules that allow me to display an error message across all browsers while still setting the status to 403 Forbidden?

下面是此状态的RFC信息:

Here is the RFC info on this status:

服务器理解请求,但
  拒绝执行它。
  授权将无助和
  请求不应该重复。如果
  请求方法不是头和
  服务器希望公开为什么
  请求未得到满足,它
  应该说明的原因
  拒绝在实体。如果服务器
  不希望将这些信息
  提供给客户机时,状态
  code 404(未找到)可以用于
  来代替。

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浏览器就不会显示出来。

It seems like I should be setting a message but IE just won't display it.

推荐答案

试着让你的网页403大(即多个字节)。有些浏览器假设一个简短的错误页面是从Web服务器的默认页面,并决定展现自己,presumably更有帮助文本。

Try making your 403 page larger (i.e. more bytes). Some browsers assume that a short error page is the default page from the web server and decide to show their own, presumably more helpful text.

更多信息

这篇关于在403 Forbidden错误浏览器行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆