我想将带有某些触发词的传入查询字符串重定向到404。
背景:
长话短说。
htaccess的:
RewriteEngine on
RewriteCond %{THE_REQUEST} !^.*\/wp-login\.php?(.*)
RewriteCond %{THE_REQUEST} !^.*\/wp-admin\/(.*)
RewriteCond %{QUERY_STRING} . [NC]
RewriteCond %{QUERY_STRING} !^wordfence_logHuman= [NC] #### allow wordfence
RewriteCond %{QUERY_STRING} !^p= [NC] #### allow post/page previews
RewriteCond %{QUERY_STRING} !^page_id= [NC] #### allow cornerstone
RewriteCond %{QUERY_STRING} !^s= [NC] #### to allow for search page urls
RewriteCond %{QUERY_STRING} !^ver= [NC] #### to allow for .js and .css files that have version numbers
RewriteCond %{QUERY_STRING} !^rsd= [NC] #### to allow for some feed urls
RewriteRule (.*) /my-404.php? [L,R=404] #### my-404.php is a dummy 404 page uri - it could be nearly anything
毯子/?到404重定向打破了很多wordpress功能。我觉得我应该改变方法,以便只有某些垃圾词(vuitton,young,dildo等)会导致404。
这样我就可以保持完整的wordpress功能,同时阻止传入的查询字符串垃圾邮件被重定向到主页并由谷歌索引。
思想/帮助?