2012-04-27 157 views

回答

5

使用此在web.config文件:

<httpErrors errorMode="Custom" existingResponse="Replace"> 
    <remove statusCode="404" /> 
    <error statusCode="404" responseMode="ExecuteURL" path="/Errors/NotFound" /> 
</httpErrors> 
12

我太在和在IIS7 .htm页面(ASP不,不是.NET)同样的问题。

<system.webServer>改变responseModeFile而不是ExecuteURL和一切工作:

<httpErrors errorMode="Custom" existingResponse="Replace"> 
    <remove statusCode="404" /> 
    <error statusCode="404" responseMode="File" path="error.htm" /> 
</httpErrors>