IIRC, there's a story on this site, by its founder, describing how he did exactly that for some "citysearch" type site he was building ten or so years ago, or more.
Brad's got a point, mod_rewrite can do this, but you can also do it with PHP and Apache by using a ForceType directive and writing a script that reads the QS and/or REQUEST_URI to parse its configuration vars....