If you are running IIS 7.x, there is a very simple solution to handle 404 (Page Not Found). I found this solution from
<system.webServer> <httpErrors errorMode="Custom" existingResponse="Replace"> <remove statusCode="404" /> <error statusCode="404" responseMode="ExecuteURL" path="/Error/PageNotFound" /> </httpErrors> </system.webServer>