How to make a redirect in htaccess?

If the link ends with ?A or on ?B, do 301 redirect on the same link, but without these parameters.

For example: site.ru/company/?A -> site.ru/company/
April 3rd 20 at 17:17
1 answer
April 3rd 20 at 17:19
Solution
RewriteCond %{QUERY_STRING} A|B
RewriteRule (.*) /$1? [R=301,L]

Find more questions by tags htaccess