Forum Moderators: phranque
### Remove query strings on all requested URLs
RewriteCond %{THE_REQUEST} [?]
RewriteRule ^(.*)$ http://www.example.com/$1? [R=301,L]
### Remove trailing slash(es) and query strings on all requested html and htm "page" URLs
RewriteCond %{THE_REQUEST} [?]
RewriteRule ^/?(.+\.html?)/+$ http://www.example.com/$1? [R=301,L]
#
### Remove query strings on all remaining requested URLs
RewriteCond %{THE_REQUEST} [?]
RewriteRule ^/?(.*)$ http://www.example.com/$1? [R=301,L]
Otherwise, you're wasting time and effort, yours as well as others.
...defined by a module not included in the server configuration.
...make a list of all "wrong-URL variables" and what you want to do with the URLs if they contain those "errors." Then modify the code above to do what you want.
Others here respond with a correct solution to meet your requirement.
Then you add further requirements by saying...