我在web.config 里这样配置: <customErrors mode="RemoteOnly" defaultRedirect="comments.aspx" >
error statusCode="404" redirect="comments.aspx" />
</customErrors> 发现这个配置只对aspx类的页面出错起作用!
例如 别人随便访问不存在的aspx的网页,这样可以成功的转到 comments.aspx但如果别人随便打开一个 asp 或 html的网页,刚显示404错误,说找不到文件,不能转到设定的 comments.aspx页面想请教一下,问题出在哪里?如何正确配置?谢谢!
error statusCode="404" redirect="comments.aspx" />
</customErrors> 发现这个配置只对aspx类的页面出错起作用!
例如 别人随便访问不存在的aspx的网页,这样可以成功的转到 comments.aspx但如果别人随便打开一个 asp 或 html的网页,刚显示404错误,说找不到文件,不能转到设定的 comments.aspx页面想请教一下,问题出在哪里?如何正确配置?谢谢!
==>
<error statusCode="404" redirect="comments.aspx" />
html的网页,IIS自己处理了可以在iis里配置下
<customErrors mode="RemoteOnly" defaultRedirect="about/comments.aspx" >
<error statusCode="404" redirect="about/comments.aspx" />
<error statusCode="403" redirect="about/comments.aspx" />
<error statusCode="500" redirect="about/comments.aspx" />
</customErrors>
试试这个,找IIS页面那块有
无论网站出是什么错误,都指向我的处理出错的页面!