当我像这样配置Web.config
文件时:
<configuration>
<system.web>
<compilation debug="true" strict="false" explicit="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
<customErrors mode="On" defaultRedirect="err_404.html">
<error statusCode="404" redirect="err_404.html" />
<error statusCode="403" redirect="err_403.html" />
</customErrors>
</system.web>
我收到500.19内部服务器错误。我该如何解决这个问题?
答案 0 :(得分:0)
试试这个
<system.web>
<customErrors mode="On" redirectMode="ResponseRewrite">
<error statusCode="500.19" redirect="~/Views/ErrorMessages/Oops.cshtml" />
</customErrors>
</system.web>
<system.webServer>
<httpErrors errorMode="Custom" existingResponse="Replace">
<remove statusCode="500.19" subStatusCode="-1" />
<error statusCode="500.19" prefixLanguageFilePath="" path="~/Views/ErrorMessages/Oops.cshtml"
responseMode="ExecuteURL" />
</httpErrors>
</system.webServer>