通过执行 URL 的 IIS7 自定义错误页面

发布于 2024-12-22 07:22:52 字数 509 浏览 4 评论 0原文

在 IIS7 中,我配置了自定义错误页面 (reportError.asp) 来处理 500 状态代码,响应操作设置为“执行 URL”。此页面 (reportError.asp) 通过调用 COM 库报告 asp 错误的详细信息,COM 库反过来检索 asp 最后的错误对象(以及其他类似请求、响应、会话)并生成全面的错误报告。在 IIS6 中一切正常。

在IIS7中生成的报告包含与reportError.asp页面相关的详细信息,而不是与发生错误的原始页面相关的详细信息,即PATH_TRANSLATED服务器变量包含reportError.asp文件的路径而不是原始文件的路径,错误号和描述为空。 看起来 IIS7 使用不同的方法将控制传递给自定义错误页面。

我在生成的报告中注意到查询字符串变量包含以下值:500;[这里是原始页面的完整 URL] 这让我认为 IIS7 会进行一些内部重定向到自定义错误页面,并将原始页面作为查询字符串传递以供参考,而在 IIS6 中则以不同的方式处理。

有谁知道 IIS7 与 II6 相比在这方面的行为有何变化?

In IIS7 I've got configured custom error page (reportError.asp) to handle 500 status code, the response action is set to "Execute URL". This page (reportError.asp) reports details of asp error by calling COM library which in turn retrieves asp last error object (and other like request, response, session) and generates a comprehensive error report. All works correctly in IIS6.

In IIS7 generated report contains details related to reportError.asp page, not to the original page where error occurred i.e. PATH_TRANSLATED server variable contains path to reportError.asp file not to the original file, error numbers and descriptions are blank.
It looks like IIS7 uses different method of passing control to the custom error page.

What I noticed in the generated report that the query string variable contains following value: 500;[here full URL of the original page]
which make me think that IIS7 makes some internal Redirect to custom error page and passes original page as a query string for reference while in IIS6 it was handled in a different way.

Does anyone know of the change in behaviour in this area of IIS7 as compared to II6?

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

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

发布评论

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

评论(1

等你爱我 2024-12-29 07:22:52

ASP 应用程序的自定义错误处理页必须设置为 500.100 状态代码。当仅设置 500 状态代码时,页面将被执行,但 ASP 错误的上下文不可用。

The custom error handling page for ASP applications has to be set for 500.100 status code. When set only for 500 status code the page is executed, but context of ASP error is not available.

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