A quick read of the tutorial (perhaps the example code, too) of the link in my signature will help you to understand the power of Apache's mod_rewrite module.
As for your question, you have insufficient information contained in the new URI to redirect to your original URI (with the query string). Don't despair, though, as I've created a website for a client (http://wilderness-wally.com) where you can't see the script which serves the many pages nor can you access the primary key of each article. Very simply, the articles are accessed by the title field of the article's record with a bit of slight-of-hand by mod_rewrite (as briefly described in the tutorial).
Of course, if you are a sysadmin, simply use a RewriteMap to map from one input to the output values you require. If not, you can create a "handler file" to do the same thing via a look-up in either a flat-file or database but that takes some nice PHP to work that out in addition to the mod_rewrite (to only redirect the "file not found" redirections to the handler script).
Of course, this is all referenced briefly in the tutorial.