在我的 web.config 中,我有:
<customErrors mode="On" defaultRedirect="~/Error.aspx" redirectMode="ResponseRewrite">
<error statusCode="500" redirect="~/Error.aspx" />
<error statusCode="404" redirect="~/404.aspx" />
</customErrors>
然而,对于这些 URL,只有定义了文件扩展名的第二个有效,另一个返回蓝屏 404“应用程序中的服务器错误”。
http://127.0.0.1/scirranew/invalidpath
http://127.0.0.1/scirranew/invalidpath.aspx
有任何想法吗?我在 ASP.net 4、IIS 7.5 上。