I would remove color_new=any-value-could-be-here anywhere in URL via .htaccess So how to do it?
1 Answer
You can use this rule to remove a query parameter from any where in query string:
RewriteEngine On
RewriteCond %{QUERY_STRING} ^(.+?&)?color_new=[^&]*(?:&(.*))?$
RewriteRule ^ %{REQUEST_URI}?%1%2 [R=302,L]
Keep this rule above other rules.
3 Comments
anubhava
I use 302 for testing phase to avoid bad cache in browsers. Once you verify rule is working fine for you then you can change 302 to 301.
Kevin Smith
It works man! I really need your help on my last question, can you work on it as it's more complicated. thanks
Kevin Smith