我正在尝试为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