【发布时间】:2014-03-04 11:53:27
【问题描述】:
出现内部服务器错误...想要在错误“404 Page not found”时重定向页面。
<?xml version="1.0"?>
<configuration>
<system.web>
<urlMappings enabled="true">
<add url="~/Error404" mappedUrl="~/Error404.aspx"/>
</urlMappings>
<pages controlRenderingCompatibilityVersion="4.0"/>
<customErrors mode="on" defaultRedirect="~/Error404">
<error statusCode="404" redirect="~/Error404" />
<error statusCode="500" redirect="~/Error404" />
</customErrors>
</system.web>
<system.webServer>
<httpErrors>
<remove statusCode="404" subStatusCode="-1" />
<error statusCode="404" path="/Error404" responseMode="ExecuteURL"/>
</httpErrors>
<modules runAllManagedModulesForAllRequests="true" />
</system.webServer>
</configuration>
【问题讨论】:
标签: asp.net iis iis-7 web-config