我們已經設置了自定義的404錯誤頁面,以便顯示「nice」頁面而不是默認的IIS頁面。即使使用自定義404錯誤頁面也可獲取默認的404錯誤頁面
當試圖訪問具有已知文件擴展名的不存在的頁面時(例如http://mydomain/dumb.aspx),將顯示自定義404頁面。
當試圖訪問文件擴展名未知的文件(例如http://mydomain/index.dumb)時,會顯示默認的404錯誤頁面。
令我百思不解的是,在IIS Web核心是處理錯誤:
ModuleName: IIS Web Core
Notification: 16
HttpStatus: 404 HttpReason: Not Found
HttpSubStatus: 0
ErrorCode: 2147942402 ConfigExceptionInfo : Notification: MAP_REQUEST_HANDLER ErrorCode: The system cannot find the file specified. (0x80070002)
但配置自定義錯誤頁的筆記考慮:
<httpErrors errorMode="Detailed">
<remove statusCode="404" subStatusCode="-1" />
<error statusCode="404" prefixLanguageFilePath="" path="/httpError" responseMode="ExecuteURL" />
</httpErrors>
我們確實有處理程序映射*但不適用於。。這可能是問題的原因嗎? 什麼是正確的配置?
加入你提的屬性的時候,我得到一個空白頁,而不是一個錯誤頁面。 我們當前httpErrors節點是: <除去的StatusCode = 「404」 subStatusCode = 「 - 1」/> <錯誤的StatusCode = 「404」 prefixLanguageFilePath = 「」 路徑=」/httpError「responseMode =」ExecuteURL「/> –
Jaepetto