2012-06-14 48 views
3

嘿傢伙正在使用Umbraco 4.7和我的服務器是IIS7想知道什麼是不適合我。我基本上想製作一個自定義錯誤頁面(404),並且我嘗試的所有內容都無法正常工作,檢查了論壇,但它仍然顯示相同的問題。Umbraco自定義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的完全新手,涉及網絡設置。

感謝 保羅

+1

管理解決此問題,轉到IIS>站點> Mywebsite>錯誤頁面> 404>編輯功能設置>將本地請求更改爲詳細的錯誤。它的工作。 –

回答

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> 

希望這個作品......

+0

我試過這個,但我得到的頁面顯示以下文本。 「頁面無法顯示,因爲發生了內部服務器錯誤。」 –

+0

我設法解決這個問題,謝謝幫助我。 –

+0

請標記爲答案,如果它幫助你 –

2

我經歷了同樣的問題,而解決方案通過索賓P塞繆爾建議爲我工作(只是複製和httpErrors元素直接粘貼到system.webserver節在你的Web.Config文件),所以我想這也是解決它paulstewart185 ...

請注意,根據http://our.umbraco.org/wiki/install-and-setup/configuring-404-pages IIS 7.5的解決方案將添加到system.webserver部分:

<httpErrors existingResponse="PassThrough"/> 
4

爲了防止有人像我在研究與Umbraco 7類似的問題時所做的那樣,在config/umbracoSettings.config文件中將trySkipIisCustomErrors值設置爲true,爲我做了這件事。

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

謝謝!這是我的問題的確切解決方案! – EranSch