Need to achieve the following: Rewrite URL using .htaccess file in case there is used parameters which is not in white list.
Example: Whitelisted parameters: phone, fax, zip
Input URL: http://hostname/adress?phone=1234567890
Resulting URL: http://hostname/adress?phone=1234567890
Input URL: http://hostname/contacts?fax=1234567
Resulting URL: http://hostname/contacts?fax=1234567
Input URL: http://hostname/test?zip=1234
Resulting URL: http://hostname/test?zip=1234
Input URL: http://hostname/test?phoneHack=1234567890
Resulting URL: http://hostname/test
Input URL: http://hostname/mytest?anotherParam=1234567890
Resulting URL: http://hostname/mytest
So far my findings:
RewriteCond %{QUERY_STRING} ^(phone|fax|zip)
RewriteRule .* http://hostname/%{REQUEST_URI}?%{QUERY_STRING}
Tool where to test: http://martinmelin.se/rewrite-rule-tester/