I solved my problem with this.
<httpErrors errorMode="Custom">
<remove statusCode="404" subStatusCode='-1' />
<remove statusCode="500" subStatusCode='-1' />
<error statusCode="404" path="/404.aspx" prefixLanguageFilePath="" responseMode="ExecuteURL" />
<error statusCode="500" path="/500.aspx" prefixLanguageFilePath="" responseMode="ExecuteURL" />
</httpErrors>
This needs to go in Web.config
, under <configuration>
> <system.webServer>
e.g.
<configuration>
<system.webServer>
<httpErrors ...>
// define errors in here ...
</httpErrors>
</system.webServer>
</configuration>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…