Deny Access to IP Spammer

81.95.146.227 . From that manage several IP Spam bots to put an average of 1500 de comments a day in one blog. That means extra traffic on the server and made unnecessary stress Akismet ;-). The best example is webmasterscafe.info Where the 2-3 minute each one appears comment spam from IP: 81.95.146.227 .

Two easy ways to block IPSites or classes IP-hate spam-bot .

1. Block access to one or more IPs / classes of IPs and / or domains from .htaccess .

Be written to the file. Htaccess in webroot following lines:

order deny,allow 
deny from all 
allow from 81.95.146.227 (baneaza un singur IP) 
allow from .numedomeniu.tld (baneaza intreg domeniul, inclusiv subdomeniile) allow from 133.123.* (banaeaza toti userii care folosesc ip-uri de la 133.123. in sus .) 
allow from 69.*.255 (baneaza toata clasa de IP-uri care incep cu 69)

2.Block an IP or domain using the PHP code at the top of the page.

$block = array(“81.95.146.227”, “123.123.69.69”);

if (in_array ($_SERVER[‘REMOTE_ADDR’], $block)) {
header(“Location: http://google.com/”);
exit();
}

PS. And I swear at the ISP… Good that this time it also tells me in the browser who to swear at :)

While reading the URL: http://www.webmasterscafe.info I encountered the following error:

* Replica zero-length

Squid did not receive any information as a result of this request.

Cache administrator is YOUR .. : D.

Passionate about technology, I like to test and write tutorials about operating systems macOS, Linux, Windows, about WordPress, WooCommerce and LEMP web server configuration (Linux, NGINX, MySQL and PHP). I write on StealthSettings.com since 2006, and a few years later I started writing on iHowTo.Tips tutorials and news about devices in the ecosystem Apple: iPhone, iPad, Apple Watch, HomePod, iMac, MacBook, AirPods and accessories.

aaa… I..play?

Leave a Comment