Crazy! I think all of my site has been targeted to get spammed by someone or maybe group.. Last 2 days ago I give notification in some of my site tell them to stop spamming or I will banned them. Mostly they are spamming for V****a, x**, p**n, rubbish stuff, etc. Seems like spam business make a lot money for them… eh?

Looks like they was thinking I’m joke? hell no I’m not joke this time *bad temperament lol* I banned all they IP from accessing my website. I don’t care about traffic may decrease for a weeks this stupid guys group must be stopped!

I searching the way to do it and i found it lately to play with simple .htaccess file to stop this noob from spamming..

blocking their IP using this sample code:

## USER IP BANNING
<Limit GET POST>
order allow,deny
deny from 123.123.123.123
deny from 123.123.123.
deny from 123.123.
deny from 123.
allow from all
</Limit>

Read the rules:

123.123.123.123 (Blocks a specific IP address)
123.123.123. (Blocks ALL IPs within the range 123.123.123.xxx)
123.123. (Blocks ALL IPs within the range 123.123.xxx.xxx)
123. (Blocks ALL IPs within the range 123.xxx.xxx.xxx)

I recommended you to blocks specific IP adress to minimize your lost traffic.

Now for disable hotlinking from bandwith stealer use this sample code:


## DISABLE HOTLINKING
RewriteEngine on
# Options +FollowSymlinks
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?yourdomain.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?yourotherdomain.com/.*$ [NC]
RewriteRule \.(gif|jpg|jpeg|png|js|css)$ – [F]

Read the rules:

yourdomain.com and yourotherdomain.com is allowed site that can show hotlinking files you can use your hosting IP address too.

gif|jpg|jpeg|png|js|css is file (extension) that should be disallowed from hotlinking:

Banned bad referrer using this sample code:

## SITE REFERRER BANNING
RewriteEngine on
# Options +FollowSymlinks

RewriteCond %{HTTP_REFERER} badsite\.com [NC,OR]
RewriteCond %{HTTP_REFERER} badsite\. [NC,OR]
RewriteCond %{HTTP_REFERER} sub\.badsite\.com [NC]
RewriteRule .* – [F]

Read the rules:

badsite.com (Blocks traffic coming from badsite.com)
badsite. (Blocks traffic coming from all varieties of badsite.xxx, such as badsite.com, badsite.net etc)
sub.badsite.com(Blocks traffic coming from sub.badsite.com
You can use IP adress too.

That’s all for today, have a nice day 😛

Similar Posts:

    Digg Del.icio.us StumbleUpon Reddit Twitter RSS

If you're new here, you may want to subscribe to my RSS feed. You may copy or publish this article to your blog or other site as long you give credit link back to this site article. Thanks for visiting my blog!