as you can see from MSDN,
there is a configuration setting from IIS instead of asp.net router to handle all http error for all request
<system.webServer> <httpErrors errorMode="Custom"> <remove statusCode="401" subStatusCode='-1' /> <remove statusCode="404" subStatusCode='-1' /> <remove statusCode="500" subStatusCode='-1' /></httpErrors> </system.webServer>