thank you for this article.
I Created a 404 page as you mentioned and added some component to customize content displayed.
I disabled the processor to override Sitecore's default 404.
I set also ItemNotFoundUrl <setting name="ItemNotFoundUrl" value="/404" />
In web.config I didn't added any specific configuration in section customErrors and httpErrors for 404 statutscode just added paths in httpErrors for 400,405 and 500 statuscode.
Added 404 and 500 in Settings
Trying that I still got 200 statuscode
Stilling have the issue, I added also a controller rendering to set statusCode
public class PageNotFoundController : Controller
{
public ActionResult Request404Page()
{
System.Web.HttpContext.Current.Response.TrySkipIisCustomErrors = true;
System.Web.HttpContext.Current.Response.StatusCode = 404;
System.Web.HttpContext.Current.Response.StatusDescription = "404 File Not Found";
return View();
}
}
and the the view is empty
But testing that still have the issue 200 statuscode returned. Any ideas?