需要做到以下几点: 使用.htaccess 文件重写URL,以防使用了不在白名单中的参数。
示例:列入白名单的参数:电话、传真、邮编
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
到目前为止,我的发现:
RewriteCond %{QUERY_STRING} ^(phone|fax|zip)
RewriteRule .* http://hostname/%{REQUEST_URI}?%{QUERY_STRING}