IIS 7.0 Custom Error page for error code with a substatus

强颜欢笑 提交于 2019-12-10 19:56:27

问题


Has anybody successfully created a Custom error page using:

  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

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.

Secondary questions:

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?


回答1:


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

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



来源:https://stackoverflow.com/questions/7168191/iis-7-0-custom-error-page-for-error-code-with-a-substatus

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!