2010年7月30日星期五

在iis7中(本地调试时)怎样显示自定义404页面



和iis6.0不同,本地调试时显示自定义404页面需要一些设置:

这是微软iis社区的anilr的答案

IIS7 has a new functionality to display detailed error page containing information needed to troubleshoot an error - by default, requests from localhost get the detailed error page and only remote requests get the custom error page that you have configured, to change this, you have to change the errorMode attribute in system.webServer/httpErrors from the default of DetailedLocalOnly to Custom

意思是IIS7在错误页面显示时使用一个新的功能:默认情况在本地调试时(localhost)将显示详细的错误信息,而远程访问才会显示自定义的错误页面,因此必须手动进行设置才能实现本地也显示自定义错误页面,方式是打开站点,打开功能区的“错误页”,在右边的“操作”点击“编辑功能设置”,“自定义错误页”,ok。



没有评论:

发表评论