for all errors, this solution is helpful. Currently, we have the following code in web.config:
<httpErrors errorMode="Custom" existingResponse="Replace" defaultResponseMode="File">
<remove statusCode="404" subStatusCode="-1"/>
<error statusCode="404" subStatusCode="-1" path="/www/home/page-not-found" responseMode="ExecuteURL"/>
<remove statusCode="500" subStatusCode="-1"/>
<error statusCode="500" subStatusCode="-1" path="/error-500.html" responseMode="ExecuteURL"/>
</httpErrors>
We should replace it with this one:
<httpErrors errorMode="Custom" defaultResponseMode="File">
<remove statusCode="404" subStatusCode="-1"/>
<error statusCode="404" subStatusCode="-1" path="/www/home/page-not-found" responseMode="ExecuteURL"/>
<remove statusCode="500" subStatusCode="-1"/>
<error statusCode="500" subStatusCode="-1" path="/error-500.html" responseMode="ExecuteURL"/>
</httpErrors>
which we deleted from the above code this: existingResponse="Replace"