【发布时间】:2011-11-15 23:05:34
【问题描述】:
当用户尝试访问不存在的目录时,我需要重定向到我的通用错误页面。我在 web.config 中设置了以下内容:
<system.web>
<customErrors mode="RemoteOnly" defaultRedirect="errorpages/404.htm">
</customErrors>
</system.web>
当我访问一个不存在的文件(例如 xyc.com/does_not_exist.aspx)但当我访问一个不存在的文件夹(例如 xyz.com/does_not_exist)时,它就像一个魅力一个普通的 404 而不是一般的错误页面。
我错过了什么?
最好的问候, 史蒂芬
【问题讨论】:
标签: asp.net redirect http-status-code-404