{"id":619,"date":"2011-07-28T15:09:20","date_gmt":"2011-07-28T19:09:20","guid":{"rendered":"http:\/\/www.blogseye.com\/?p=619"},"modified":"2011-07-28T15:10:22","modified_gmt":"2011-07-28T19:10:22","slug":"htaccess-file-to-block-some-spammers","status":"publish","type":"post","link":"http:\/\/blogseye\/2011\/07\/htaccess-file-to-block-some-spammers.html","title":{"rendered":".htaccess file to block some spammers"},"content":{"rendered":"

I find referer spam annoying. Referer spam is spam that appears in my log as bogus http_referer entries – referer is misspelled for historic reasons. I also think that spammers who drop by also leave their dirt behind in the logs. By blocking certain strings in the referrer string, I think I can stop a few spammers also.<\/p>\n

I’ve been testing the following referer string block. I have no idea if it is working, yet. I am going to set a bogus page with one of the strings in it to test it out.<\/p>\n

Make a backup copy of your .htaccess file and then copy this stuff into the top of the file.<\/p>\n

Test it. I got 500 errors when I made a mistake, so be sure you have a backup copy that works in order to restore the file if it breaks your site.<\/p>\n

Make sure you leave the wordpress stuff and anything else needed to run your site after this code.<\/p>\n

<IfModule mod_rewrite.c>\r\nRewriteEngine On\r\nRewriteBase \/\r\n# referrer spam\r\nRewriteCond %{HTTP_REFERER} poker [NC,OR]\r\nRewriteCond %{HTTP_REFERER} viagra [NC,OR]\r\nRewriteCond %{HTTP_REFERER} casino [NC,OR]\r\nRewriteCond %{HTTP_REFERER} sex [NC,OR]\r\nRewriteCond %{HTTP_REFERER} qzone [NC,OR]\r\nRewriteCond %{HTTP_REFERER} jokes [NC,OR]\r\nRewriteCond %{HTTP_REFERER} calories [NC,OR]\r\nRewriteCond %{HTTP_REFERER} alliatemarketing [NC,OR]\r\nRewriteCond %{HTTP_REFERER} mafia [NC,OR]\r\nRewriteCond %{HTTP_REFERER} erotic [NC,OR]\r\nRewriteCond %{HTTP:VIA} ^.+pinappleproxy [NC,OR]\r\nRewriteCond %{HTTP_REFERER} nestseekers [NC,OR]\r\nRewriteCond %{HTTP_REFERER} porn [NC,OR]\r\nRewriteCond %{HTTP_REFERER} advair [NC,OR]\r\nRewriteCond %{HTTP_REFERER} allegra [NC,OR]\r\nRewriteCond %{HTTP_REFERER} ambien [NC,OR]\r\nRewriteCond %{HTTP_REFERER} amoxicillin [NC,OR]\r\nRewriteCond %{HTTP_REFERER} baccarat [NC,OR]\r\nRewriteCond %{HTTP_REFERER} blackjack [NC,OR]\r\nRewriteCond %{HTTP_REFERER} cash [NC,OR]\r\nRewriteCond %{HTTP_REFERER} casino [NC,OR]\r\nRewriteCond %{HTTP_REFERER} celeb [NC,OR]\r\nRewriteCond %{HTTP_REFERER} cheap [NC,OR]\r\nRewriteCond %{HTTP_REFERER} cialis [NC,OR]\r\nRewriteCond %{HTTP_REFERER} craps [NC,OR]\r\nRewriteCond %{HTTP_REFERER} credit [NC,OR]\r\nRewriteCond %{HTTP_REFERER} deal [NC,OR]\r\nRewriteCond %{HTTP_REFERER} debt [NC,OR]\r\nRewriteCond %{HTTP_REFERER} drug [NC,OR]\r\nRewriteCond %{HTTP_REFERER} effexor [NC,OR]\r\nRewriteCond %{HTTP_REFERER} equity [NC,OR]\r\nRewriteCond %{HTTP_REFERER} faxo [NC,OR]\r\nRewriteCond %{HTTP_REFERER} finance [NC,OR]\r\nRewriteCond %{HTTP_REFERER} gambling [NC,OR]\r\nRewriteCond %{HTTP_REFERER} hold-em [NC,OR]\r\nRewriteCond %{HTTP_REFERER} holdem [NC,OR]\r\nRewriteCond %{HTTP_REFERER} iconsurf [NC,OR]\r\nRewriteCond %{HTTP_REFERER} insurance [NC,OR]\r\nRewriteCond %{HTTP_REFERER} interest [NC,OR]\r\nRewriteCond %{HTTP_REFERER} internetsupervision [NC,OR]\r\nRewriteCond %{HTTP_REFERER} keno [NC,OR]\r\nRewriteCond %{HTTP_REFERER} levitra [NC,OR]\r\nRewriteCond %{HTTP_REFERER} lipitor [NC,OR]\r\nRewriteCond %{HTTP_REFERER} loan [NC,OR]\r\nRewriteCond %{HTTP_REFERER} meds [NC,OR]\r\nRewriteCond %{HTTP_REFERER} money [NC,OR]\r\nRewriteCond %{HTTP_REFERER} mortgage [NC,OR]\r\nRewriteCond %{HTTP_REFERER} omaha [NC,OR]\r\nRewriteCond %{HTTP_REFERER} paxil [NC,OR]\r\nRewriteCond %{HTTP_REFERER} pharmacy [NC,OR]\r\nRewriteCond %{HTTP_REFERER} pharmacies [NC,OR]\r\nRewriteCond %{HTTP_REFERER} phentermine [NC,OR]\r\nRewriteCond %{HTTP_REFERER} pheromone [NC,OR]\r\nRewriteCond %{HTTP_REFERER} pills [NC,OR]\r\nRewriteCond %{HTTP_REFERER} poker [NC,OR]\r\nRewriteCond %{HTTP_REFERER} refinance [NC,OR]\r\nRewriteCond %{HTTP_REFERER} roulette [NC,OR]\r\nRewriteCond %{HTTP_REFERER} seventwentyfour [NC,OR]\r\nRewriteCond %{HTTP_REFERER} slot [NC,OR]\r\nRewriteCond %{HTTP_REFERER} syntryx [NC,OR]\r\nRewriteCond %{HTTP_REFERER} texas [NC,OR]\r\nRewriteCond %{HTTP_REFERER} tournament [NC,OR]\r\nRewriteCond %{HTTP_REFERER} tramadol [NC,OR]\r\nRewriteCond %{HTTP_REFERER} tramidol [NC,OR]\r\nRewriteCond %{HTTP_REFERER} valtrex [NC,OR]\r\nRewriteCond %{HTTP_REFERER} viagra [NC,OR]\r\nRewriteCond %{HTTP_REFERER} vicodin [NC,OR]\r\nRewriteCond %{HTTP_REFERER} xanax [NC,OR]\r\nRewriteCond %{HTTP_REFERER} zanax [NC,OR]\r\nRewriteCond %{HTTP_REFERER} zoloft [NC]\r\nRewriteRule .* - [F]\r\n<\/IfModule><\/pre>\n","protected":false},"excerpt":{"rendered":"

I find referer spam annoying. Referer spam is spam that appears in my log as bogus http_referer entries – referer is misspelled for historic reasons. I also think that spammers who drop by also leave their dirt behind in the logs. By blocking certain strings in the referrer string, I think I can stop a […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/blogseye\/wp-json\/wp\/v2\/posts\/619"}],"collection":[{"href":"http:\/\/blogseye\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blogseye\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blogseye\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blogseye\/wp-json\/wp\/v2\/comments?post=619"}],"version-history":[{"count":0,"href":"http:\/\/blogseye\/wp-json\/wp\/v2\/posts\/619\/revisions"}],"wp:attachment":[{"href":"http:\/\/blogseye\/wp-json\/wp\/v2\/media?parent=619"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blogseye\/wp-json\/wp\/v2\/categories?post=619"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blogseye\/wp-json\/wp\/v2\/tags?post=619"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}