I want the next request :

http://somesite.com/home.php?action=page&page_id=9

to trigger a 301 redirect to :

http://somesite.com/a-new-page

This is what I am using however it is not working.

RewriteCond %{QUERY_STRING} ^page_id=9$ [NC]
RewriteRule ^home\.php$ http://somesite.com/a-new-page? [L,R=301]

Any ideas?

When the QUERY_STRING will be exactly the same you have to match it such as this:

RewriteEngine on
RewriteCond %{QUERY_STRING} ^action=page&page_id=9$ [NC]
RewriteRule ^home.php$ http://somesite.com/a-new-page? [L,R=301]

Hope this can help.