I know the title is a bit vague, and I know there 101 ways to tackle this and probably the most accepted way is at the web server level with MOD re-write or ISAPI. But at that level its harder to incorporate business logic or custom data.
So what if you are on a shared host that does not allow MOD-REWRITE or the IIS version ISAPI rewrite, but will allow a custom 404 file, AND the SEO requirement is to hide the real file name?
For instance, suppose you need the URL to look something like this:
http://www.server.com/{1st resource}/{2nd resource}/{3rd resource}
Maybe a search URL like:
http://www.server.com/bmw/4 door/blue/
OR
http://www.server.com/Charlotte/2 story/4 bath rooms/