带有子状态的错误代码的"IIS 7.0自定义错误"页面 [英] IIS 7.0 Custom Error page for error code with a substatus

查看:79
本文介绍了带有子状态的错误代码的"IIS 7.0自定义错误"页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人使用以下方法成功创建了自定义错误"页面吗?

Has anybody successfully created a Custom error page using:

  1. IIS 7.0 GUI
  2. 子状态错误代码(例如404.13).
  3. 使用在此站点上执行网址"(而不是静态文件或 重定向选项)
  4. .asp错误页面
  1. The IIS 7.0 GUI
  2. a substatus error code (e.g. 404.13).
  3. using "Execute a Url on this site" (as opposed to the static File or Redirect options)
  4. an .asp error page

我能够获取显示自定义404.13错误消息的应用程序(这是一个传统的经典.asp应用程序)的唯一方法是对静态文件(.htm)使用重定向选项,或者对静态文件使用文件系统中带有htm文件的文件选项.

The only ways I have been able to get my application, which is a legacy classic .asp app, to display a custom 404.13 error message is to either use the redirect option with a static file (.htm) or use the static file option with an htm file from the file system.

次要问题:

IIS 7是否有针对子状态错误代码的自定义错误页面的限制?

Is there some restriction is IIS 7 to custom error pages for substatus error codes?

此外,出于安全考虑,是否建议返回子状态代码?

Also, is it ever recommended to return a substatus code because of security concerns?

推荐答案

<system.webServer><httpErrors>元素中,您可以指定subStatusCode属性:

In the <httpErrors> element of <system.webServer> you can specify a subStatusCode attribute: http://www.iis.net/ConfigReference/system.webServer/httpErrors/error

但是,ASP.NET配置元素(<system.web>的子级不支持子状态代码.

However the ASP.NET configuration elements (children of <system.web> do not support sub-status codes.

这篇关于带有子状态的错误代码的"IIS 7.0自定义错误"页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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