404;1、404;2 等 HTTP 错误代码有何用途?

发布于 2024-07-07 18:35:49 字数 196 浏览 6 评论 0 原文

在 IIS 中,我可以配置自定义错误页面。
对于每个 HTTP 错误代码,我都可以说出去哪里。 一些代码有许多可用的“子”代码。 例如,404 有常规的 404、404;1、404;2 等等。

它们的用途是什么? 他们什么时候回来? 我应该为这些错误制作自定义页面吗? 我可以以某种方式轻松配置所有代码“系列”以进入同一页面吗?

In IIS I can configure my custom error pages.
For each HTTP Error code I can say where to go. Several codes have a number of "sub" codes available. For example 404 has a regular 404, 404;1, 404;2 and so on..

What are they for? When are they returned? Should I make custom pages for these errors? Can I somehow easely configure all code "families" to come to the same page?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

酒浓于脸红 2024-07-14 18:35:49

401 - 访问被拒绝。 IIS 定义了几种不同的 401 错误,这些错误指示更具体的错误原因。 这些特定错误代码显示在浏览器中,但不会显示在 IIS 日志中:

  • 401.1 - 登录失败。
  • 401.2 - 由于服务器配置导致登录失败。
  • 401.3 - 由于资源上的 ACL 而未经授权。
  • 401.4 - 过滤器授权失败。
  • 401.5 - ISAPI/CGI 应用程序授权失败。
  • 401.7 – Web 服务器上的 URL 授权策略拒绝访问(此错误代码特定于 IIS 6.0。)

以下是 MSDN 文档中 完整列表 .microsoft.com/kb/318380" rel="noreferrer">IIS 5.0 和 6.0 以及 IIS 7.0、7.5 和 8.0

如果您想根据这些子代码向访问者或用户显示一条不错的自定义消息,您可以这样做。 但你不需要。

401 - Access denied. IIS defines several different 401 errors that indicate a more specific cause of the error. These specific error codes are displayed in the browser but are not displayed in the IIS log:

  • 401.1 - Logon failed.
  • 401.2 - Logon failed due to server configuration.
  • 401.3 - Unauthorized due to ACL on resource.
  • 401.4 - Authorization failed by filter.
  • 401.5 - Authorization failed by ISAPI/CGI application.
  • 401.7 – Access denied by URL authorization policy on the Web server (This error code is specific to IIS 6.0.)

Here is the complete list in the MSDN documentation for IIS 5.0 and 6.0 and for IIS 7.0, 7.5 and 8.0.

If you want to show your visitors or users a nice custom message depending on these subcode, you could do it. But you needn't.

云朵有点甜 2024-07-14 18:35:49

“子状态”错误代码特定于 IIS。 它们用于“内部”日志记录目的 - 无论子状态代码是什么,它都是返回给客户端的父错误(404.2 作为 404 发送回)。

它们专门用于减少 IIS 的攻击面,同时仍然提供拥有大量数据的系统管理员。 因此,您不应该发回特定的子状态错误消息,因为您的 IIS 安装可能会受到攻击。

参考

"Substatus" error codes are specific to IIS. They are for "internal" logging purposes - whatever the substatus code, it is the the parent error that gets returned to the client (404.2 gets sent back as 404)

They were implemented specifically to reduce the surface area of attack of IIS whilst still providing sysadmins with a meaningful amount of data. Therefore you actively should not send back specific substatus error messages as you will be opening your IIS installation to possible attack.

Reference

苏佲洛 2024-07-14 18:35:49

这篇博客文章似乎对此做了很多解释。 也许有帮助? 至少,它解释了“子代码”的含义。

This blog article appears to explain a lot of this. Perhaps it can be of help? At the very least, it explains the meaning of the 'sub-codes'.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文