public static void FileNotFoundExceptionHandler(object sender, EventArgs e)
{
HttpContext context = GetContext();
if (context == null)
return;
if (CheckForException(context, context.Request.Url))
{
context.Response.Clear();
context.Response.TrySkipIisCustomErrors = true;
context.Server.ClearError();
context.Response.StatusCode = 404;
}
}