Umbraco自定义404错误页面不起作用

时间:2012-06-14 15:34:16

标签: redirect http-status-code-404 umbraco

嘿伙计们正在使用Umbraco 4.7和我的服务器是IIS7想知道什么是不适合我。我基本上想要制作一个自定义错误页面(404),我尝试的一切都不起作用,检查论坛,但它仍然显示同样的问题。

我已经编辑了我的umbracoSettings.config

<errors>
   <!-- the id of the page that should be shown if the page is not found -->
   <!-- <errorPage culture="default">1647</errorPage> -->
   <!-- <errorPage culture="en-US">1647</errorPage> -->
   <error404>1647</error404>
</errors>

此外,我已经考虑过将此添加到web.config文件中。

<httpErrors errorMode="Custom" existingResponse="Replace">
   <remove statusCode="404" subStatusCode="-1" />
   <error statusCode="404" prefixLanguageFilePath="" path="/error.aspx" responseMode="ExecuteURL" />
</httpErrors>

任何帮助都将受到高度赞赏。我是IIS的完整新手和涉及网络设置的任何事情。

由于 保罗

3 个答案:

答案 0 :(得分:17)

确保1647是404页面的节点ID。

还要在web.config中的system.webServer标记中添加以下代码。

<httpErrors>
    <remove statusCode="404" subStatusCode="-1" />
    <error statusCode="400" path="/404" responseMode="ExecuteURL" />
    <error statusCode="404" path="/404" responseMode="ExecuteURL" />
</httpErrors>

希望这有效......

答案 1 :(得分:4)

万一有人偶然发现了这个问题,就像我在研究Umbraco 7的类似问题时所做的那样,在config / umbracoSettings.config文件中将trySkipIisCustomErrors值设置为true为我做了。

  <web.routing
    trySkipIisCustomErrors="true"
    internalRedirectPreservesTemplate="false">
  </web.routing>

答案 2 :(得分:2)

我遇到了同样的问题,Sobin P Samuel建议的解决方案为我工作(只需将httpErrors元素直接复制并粘贴到Web.Config文件中的system.webserver部分),所以我猜这也解决了它对于paulstewart185 ......

请注意,根据http://our.umbraco.org/wiki/install-and-setup/configuring-404-pages,IIS 7.5的解决方案是将以下内容添加到system.webserver部分:

<httpErrors existingResponse="PassThrough"/>
相关问题