我正在嘗試爲404錯誤提供自定義重定向頁面。目前,主機服務器可能存在一個不同的錯誤頁面,我的web.config文件位於下方。當我註釋掉customError標籤時,主機服務器的默認頁面顯示出來,我想將其更改爲自定義頁面「404.html」。當我取消註釋時,它可能會嘗試覆蓋默認值,但會給出內部服務器錯誤!將404重定向頁面從默認頁面更改爲自定義頁面。
<?xml version="1.0" encoding="UTF-8"?>
Please refer to machine.config.comments for a description and
the default values of each configuration section.
For a full documentation of the schema please refer to
http://go.microsoft.com/fwlink/?LinkId=42127
To improve performance, machine.config should contain only those
settings that differ from their defaults.
<configuration>
<system.webServer>
<customErrors mode="On">
<error statusCode="404" redirect="/404.html" />
</customErrors>
<!--<httpErrors>
<remove statusCode="404" subStatusCode="-1" />
<error statusCode="404" path="/404.html" responseMode="ExecuteURL" />
</httpErrors>-->
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>
它是集成/管道模式的東西嗎? – nikhil