mod_alterquery
Read mod_alterquery's docs here.
mod_alterquery is to the QUERY_STRING part of a GET request what mod_rewrite is to the rest of a URL. I wrote mod_alterquery originally as a learning exercise to explore the inner workings of Apache, but it turned into a full-fledged Apache module. You'll find the source code to be copiously documented from my learning process, so if you're looking to learn how to write your own Apache modules, read my source code and e-mail me if it was helpful.