301 redirect of a dynamic URL using mod_rewrite problem with passed on query string

I have a bit of challenge with redirecting a dynamic URL.
I am trying to redirect a URL to another URL but the resulting URL has the query string of the original URL added to it and I don’t want that. Can’t seem to find a solution anywhere…

Original URL: http://www.domain.com/CMS/index.php?Itemid=1
Target URL: http://www.domain.com

Code used in .htaccess:
RewriteEngine On
RewriteCond %{QUERY_STRING} Itemid=1
RewriteRule ^.*$ http://www.domain.com [R=301,L]

Resulting URL: http://www.domain.com/Itemid=1

Desired resulting URL: http://www.domain.com

Anyone any ideas?
Thanks!

fink,

If you’ve read the sticky post or the tutorial linked in my signature, you’ll know that adding a blank query string (simply a ? at the end of your redirection) will kill any preexisting query string (unless the QSA flag was used on that redirection).

BTW, I believe that [noparse]http://www.domain.com/[B][COLOR=“Red”]?[/COLOR][/B]Itemid=1[/noparse] would be the correct redirection.

Regards,

DK