In my file web.config I have a custom error:
<customErrors mode="On" defaultRedirect="~/Error"> <error redirect="~/Error/NotFound" statusCode="404" /> </customErrors>
My NotFound action:
public ActionResult NotFound() { Response.StatusCode = 404; //no issues when this is not set return View(); }
Problem: This configuration works fine on the local server, but when I move it to the remote server, the custom 404 pages are not displayed (the default value is 404 IIS) if the NotFound action status code is set to 200.
Can someone explain what is happening?
Maksim Vi.
source share