I use a modified version of the Smart 404 Handler script from http://evolvedcode.net/content/code_smart404/. I added code to do custom mapping based of a table in our database.
This script could easily be re-written in ASP.NET and then mapped the same way.