Hi All.
New here. Been searching threads for several days and hoped to get some help from someone please.
I have a lot of URLs that are duplicated in the SERPs because of a query string. These URLs are now no longer needed (the option on the site that generated them has been removed) so I want to get rid of them. The query string is ?currency=EUR
URL structures are as follows:
www.example.com/product-name-product-number.html?currency=EUR
www.example.com/category-name-category-number.html?currency=EUR
Basically I just need to get rid of the query string and keep the rest of the url the same so:
www.example.com/product-name-product-number.html?currency=EUR would redirect to
www.example.com/product-name-product-number.html
and
www.example.com/category-name-category-number.html?currency=EUR would redirect to
www.example.com/category-name-category-number.html
etc
Would the following do the trick?
RewriteCond %{QUERY_STRING} ^currency=EUR$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1? [R=301,L]
There is already a working rewrite rule in htaccess directing non-www to www. Would the query string rule need to go before or after that, or does it not matter?
I suspect that is probably too simplistic but I'm still getting my head round this so any help would be greatly appreciated.
Many thanks