作为配置的asp.net不显示自定义404页 [英] asp.net not displaying a custom 404 page as configured

查看:140
本文介绍了作为配置的asp.net不显示自定义404页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的web配置我有:

in my web config I have:

<customErrors mode="On">
  <error statusCode="404" redirect="~/error/404.aspx" />
</customErrors>

的http://本地主机/ MEH &LT; - 标准的404所示

http://localhost/meh <-- standard 404 is shown

HTTP://localhost/meh.aspx &LT; - 自定义404显示

http://localhost/meh.aspx <-- custom 404 is shown

HTTP://localhost/error/404.aspx &LT; - 自定义错误页我显示了希望的所有的404错误

http://localhost/error/404.aspx <-- the custom error page I want shown for all 404 errors

我如何必须设置我的web.config所有404发送到我的自定义错误?

How do I have to setup my web.config to send all 404 to my custom error?

感谢

推荐答案

您必须在IIS中配置这一点。默认情况下,只有特定的文件将打通ASP.NET框架路由...否则IIS将处理它。

You have to configure this in IIS. By default, only specific files will get routed through the ASP.NET framework... otherwise IIS will handle it.

这篇关于作为配置的asp.net不显示自定义404页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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