打开web.config
<httpErrors errorMode="Custom" existingResponse="PassThrough">
<remove statusCode="404" subStatusCode="-1" />
<error statusCode="404" prefixLanguageFilePath="" path="/404.html" responseMode="ExecuteURL" /></httpErrors>
</system.webServer>
去掉httpErrors的属性
existingResponse="PassThrough"
即可
原文:http://www.cnblogs.com/jenqz/p/4873194.html