News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Blocking Country

Started by faeriedust, May 17, 2011, 04:34:37 PM

Previous topic - Next topic

faeriedust

I don't remember what version this was in or if it was a separate mod, but is there a way to block a whole country from being able to log in? I'm sure I've used it before but have no idea what happened to it. Does anyone remember this?

Storman™

You could do it with a .htaccess file but don't get too carried away otherwise you'll end up blocking every man and his dog from your forum.

Have a read HERE

Any reason why, are you getting spammed maybe ?

faeriedust

I'm getting zillions of people from China trying to get into my board for spamming purposes. I just can't take it anymore. I'll try anything about now. Thanks for the tip.

Eudemon

just a question
altho i'm not gonna do that but this seems interesting

the code generated from that site
all u gonna do is put it in htaccess of ur root directory and that would affect all the pages?
what about u wanna show some message page to those blocked ppl
or usually this will lead them to some kinda error code page
so i only have to edit that error page like 404 in my server's control panel etc...

faeriedust

Just to make sure I did this right, is this what it should look like?

<Files *>
   Order Deny,Allow
   # Country: CHINA
# ISO Code: CN
# Total Networks: 3,405
# Total Subnets:  331,813,888
deny from 1.0.1.0/24
deny from 1.0.2.0/23
deny from 1.0.8.0/21
deny from 1.0.32.0/19
deny from 1.1.0.0/24
deny from 1.1.2.0/23
deny from 1.1.4.0/22
deny from 1.1.8.0/21
deny from 1.1.16.0/20
deny from 1.1.32.0/19
deny from 1.2.0.0/23
deny from 1.2.2.0/24
deny from 1.2.4.0/22
deny from 1.2.8.0/21
deny from 1.2.16.0/20
deny from 1.2.32.0/19
deny from 1.2.64.0/18

deny from 223.255.236.0/22
deny from 223.255.252.0/23
#


Deny from all
   Allow from localhost
</Files>


richardwbb

Are you ridding Baidu (and webwarper.net, Yandex.ru) and that kind of bandwith eating and annoying log fillers?

Can you post some log? I was able to rid those good, but it takes a couple of days, editting and re-editting and again log file checking (you can filter those easy btw with something like 'type log.txt | findstr /v "g36028"  | findstr /v "File does not exist:" > logout.txt' in Windows  8)

That makes it easier to clean up. I reply because your filter seems a little restrict by restricting more then needed. And yes, not everything can ben filtered/ blocked, but you should be able to 'make things quiet'.
If my post in this topic looks ambiguous to you, then I'm with Murphy's law and General Stupidity. In other words, trial and error.

Advertisement: