Add NotFoundHandler.CreateCustomNotFoundController

You can configure your own controller in Global.asax
NotFoundMvc.NotFoundHandler.CreateCustomNotFoundController =
requestContext =>
{
//some sort of logic...
return new MyCustomNotFoundController(requestContext);
//or return null for default functionality
}