When I migrated to my new blog, I needed to re-write all the old WordPress URLs to point to the appropriate place. The problem was that standard rewrites aren’t made based on GET parameters, so I was stuck.
Luckily Curly060 and Seph in #nginx gave me some ideas, and together we ended up with this:
If you want to do a permanent redirect, you have to clear all the arguments to prevent a redirect loop. The last stanza would look something like this: