0

我一直在搜索 Stack Overflow 和各种论坛,但我无法理解在 ASP.net 和 IIS 中捕获 HTTP 错误的过程。

此时我已经通过 web.config 配置了customErrors404 和 401 错误的重定向。放置在system.web元素内部。

<customErrors defaultRedirect="~/Errors/default.aspx" mode="RemoteOnly">
    <error statusCode="401" redirect="~/Errors/401.aspx" />
    <error statusCode="404" redirect="~/Errors/404.aspx" />
</customErrors>

<system.webServer>
    <httpErrors existingResponse="PassThrough" />
  </system.webServer>

但是,通用 IIS 错误页面显示错误:如下所示。在此处输入图像描述

缺少什么?状态码/

4

0 回答 0