I've been googling for a while trying to work out how to redirect the following url:
http://mysite.org/old-folder/?abc=1144
to a new URL:
http://mysite.org/new/folders/?xyz=1144
Where the number 1144 is dynamic.
I've got as far as this, but can't seem to get it working:
RewriteRule ^old-folder/\?abc=([0-9]+)(/)?$ new/folders/\?xyz=$1 [R=301]
RewriteRuleonly looks at the path component of the URL – if you want to check the query string, you have to use aRewriteCond…