配置404错误页

web.config:web


<system.web>ide

  <customErrors mode="On" defaultRedirect="404/index.htm">网站

     <error statusCode="404" redirect="404/index.htm" />spa

   </customErrors>htm

 </system.web>rem


<system.webServer>it

   <httpErrors errorMode="Custom" existingResponse="Auto">class

   <remove statusCode="404" subStatusCode="-1" />iis

   <error statusCode="404" prefixLanguageFilePath="" path="/404/index.htm" responseMode="ExecuteURL" />error

</httpErrors>

 </system.webServer>

额 不知道为何 写了上面这个 <httpErrors> 这段,首页也变成错误页了,

没办法删除了上面的这段代码 <httpErrors>

手动在iis里设置了下

打开IIS管理器-->选中维纳斯网站右键属性-->点击要设置自定义404的网站的属性-->点击自定义错误选项-->选中404页-->选中并打开消息类型-->设置成URL类型 --> URL里填写   /404/index.htm

-->按肯定保存退出

相关文章
相关标签/搜索