Empty parameters that I mean can be anywhere in URL each time different place, each time with different name, each time on different php page e.g :
http://www.example.com/AnyPHPpageHere.php?parameter1=7¶meter2=¶meter3=blue¶meter4=
to the form:
http://www.example.com/AnyPHPpageHere.php?parameter1=7¶meter3=blue
So how to do it via .htaccess?
You can use this URL to remove any one or more empty parameters from anywhere in URLs:
RewriteEngine On
RewriteCond %{QUERY_STRING} ^(.+?&)?[^=]+=(?:&(.*))?$
RewriteRule ^ %{REQUEST_URI}?%1%2 [R=302,L,NE]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With