Try it in root / .htaccess
RewriteEngine on
RewriteCond %{QUERY_STRING} ^.*$
RewriteRule ^/?$ /? [NC,L,R]
The empty question mark at the end of the target path is significant because it discards quignystrings orignal in apache 2.4, and later you can use the QSD flag to discard query strings.
If the above rule fails, try
RewriteEngine on
RewriteCond %{THE_REQUEST} /\?([^\s]+) [NC]
RewriteRule ^/?$ /? [NC,L,R]
source
share