1

I would remove color_new=any-value-could-be-here anywhere in URL via .htaccess So how to do it?

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

3 Comments

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.
It works man! I really need your help on my last question, can you work on it as it's more complicated. thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.