如何删除错误消息 - IIS7 [英] How to remove error messages - IIS7

查看:33
本文介绍了如何删除错误消息 - IIS7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何删除 IIS7 添加到页面顶部的错误消息.

我有自己的 500 和 404 错误页面.

不需要错误页面,我已经删除了它们,但我仍然把它放在我的页面顶部:

<块引用>

您要查找的资源已被删除、更名或暂时不可用

有什么想法吗?

解决方案

要防止 IIS7 劫持您的错误页面,请在您的 httpErrors 部分中设置 existingResponse="PassThrough"您的 web.config 文件.例如:

<预><代码><配置><system.webServer><httpErrors existingResponse="PassThrough"/></system.webServer></配置>

I'm wondering how to remove the error messages IIS7 adds to the top of the page.

I have my own 500 and 404 error pages served.

Not needing the error pages I have deleted them, but I am still getting this on top of my page:

The resource you are looking for has been removed, had its name changed, or is temporarily unavailable

Any ideas?

解决方案

To prevent IIS7 hijacking your error pages, set existingResponse="PassThrough" in your httpErrors section in your web.config file. For example:

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

这篇关于如何删除错误消息 - IIS7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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