There is a routing table that includes
routes.MapRoute("404-PageNotFound", "{*url}", new { controller = "Error", action = "PageNotFound" });
The web.config has:
<customErrors mode="RemoteOnly">
<error statusCode="404" redirect="/Error/PageNotFound" />
</customErrors>
The ErrorController gets hit when no Route Matches and the View for errors get rendered using:
public ActionResult PageNotFound(ViewModelBase model)
{
return View(model);
}
The status code for the response is 200, but in this case a 404 is required. Is there a way to return http code 404 and a custome errorpage?