我在web.config中有这个:
<httpErrors errorMode="Custom"> <remove statusCode="404" subStatusCode="-1" /> <remove statusCode="500" subStatusCode="-1" /> <error statusCode="404" prefixLanguageFilePath="" path="/Error/NotFound.aspx" responseMode="Redirect" /> <error statusCode="500" prefixLanguageFilePath="" path="/Error/ServerError.aspx" responseMode="Redirect" /> </httpErrors>
但IIS仍显示内置错误页面.
有任何想法吗?
解决方法
这就是我使用它的方式,它对我有用,除了subStatusCode指令和ExecuteURL外,它看起来非常相似.
<httpErrors> <!--Remove inherited 500 error page setting --> <remove statusCode='500' subStatusCode='-1'/> <!--Override the inherited 500 error page setting with the 'My500.html' as its path--> <error statusCode='500' subStatusCode='-1' prefixLanguageFilePath='' path='/My500.html' responseMode='ExecuteURL'/> </httpErrors>
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。