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!