 |

09-04-2005, 12:53 AM
|
 |
WebProWorld Veteran
|
|
Join Date: Jul 2003
Location: Melbourne, Australia
Posts: 541
|
|
How can I block China?
I just released some information about a free web hosting deal at newehost.com and someone told the chinese.
I have had 15 forum signups and over 100 unique visits in the last 12 hours. And it's intensifying.
Is there a way to block china from my website?
MrLeN
|

09-04-2005, 01:04 AM
|
|
WebProWorld 1,000+ Club
|
|
Join Date: Jul 2003
Location: Toronto, Canada
Posts: 2,193
|
|
Hey MrLen,
Well, I'm sure you know it will be tough to keep an entire country out, especially with ip address re-allocation and proxy servers...
however, this neat little script may help you out. Just choose china and add them to your firewall rules
Web Hosting | Webmaster Help
|

09-04-2005, 01:57 AM
|
 |
WebProWorld Veteran
|
|
Join Date: Jul 2003
Location: Melbourne, Australia
Posts: 541
|
|
Ok, sounds good so far :)
Um, .. how do I ad them to my firewall rules?
MrLeN
|

09-06-2005, 01:57 AM
|
|
WebProWorld Pro
|
|
Join Date: Jun 2004
Location: The Barrens of NE Ohio
Posts: 236
|
|
Visit this site - they maintain a complete list of all curreent Chinese and Korean IP blocks - there is also about how to use it with tools like APF.
http://www.okean.com/thegoods.html
__________________
:not_the_usual1
[you decide]
________________
All in my opinion, which, when combined carefully with a $1 bill, gets you a cup of coffee at the corner store.
|

09-06-2005, 02:00 AM
|
 |
WebProWorld Veteran
|
|
Join Date: Jul 2003
Location: Melbourne, Australia
Posts: 541
|
|
Thanks mate.
MrLeN
|

09-06-2005, 08:34 AM
|
|
WebProWorld 1,000+ Club
|
|
Join Date: Jul 2003
Location: Toronto, Canada
Posts: 2,193
|
|
Quote:
|
Originally Posted by MrLeN
Ok, sounds good so far :)
Um, .. how do I ad them to my firewall rules?
MrLeN
|
What firewall are you using?
If it is apf, then at a command prompt
Web Hosting | Webmaster Help
|

09-06-2005, 08:43 AM
|
 |
WebProWorld Veteran
|
|
Join Date: Jul 2003
Location: Melbourne, Australia
Posts: 541
|
|
Sorry, I don't know anything about server firewalls. Are you suggesting that there's a firewall on my server?
MrLeN
|

09-06-2005, 09:42 AM
|
|
WebProWorld 1,000+ Club
|
|
Join Date: Jul 2003
Location: Toronto, Canada
Posts: 2,193
|
|
Quote:
|
Originally Posted by MrLeN
Sorry, I don't know anything about server firewalls. Are you suggesting that there's a firewall on my server?
|
Uh oh... no, not suggesting, assuming.
You better have a firewall or you are opening yourself up to all kinds of trouble
Web Hosting | Webmaster Help
|

09-06-2005, 09:45 AM
|
 |
WebProWorld Veteran
|
|
Join Date: Jul 2003
Location: Melbourne, Australia
Posts: 541
|
|
ok, well I have never heard of it. I don't know how to run a server so I pay for managed servers.
Is it (the firewall) something I can get at in cPanel/WHM? Or do I have to se SSH? Or FTP?
MrLeN
|

09-06-2005, 09:52 AM
|
|
WebProWorld 1,000+ Club
|
|
Join Date: Jul 2003
Location: Toronto, Canada
Posts: 2,193
|
|
You should contact them, in this case. If your server is managed, most likely there is a firewall, but you should check to make sure.
While you are at it, ask them about banning those ip addresses
Web Hosting | Webmaster Help
|

09-06-2005, 09:58 AM
|
 |
WebProWorld Veteran
|
|
Join Date: Jul 2003
Location: Melbourne, Australia
Posts: 541
|
|
okies, that sounds easier.
Will do :)
Thanks for your help.
MrLeN
|

09-06-2005, 10:00 AM
|
|
WebProWorld 1,000+ Club
|
|
Join Date: Jul 2003
Location: Toronto, Canada
Posts: 2,193
|
|
no problem, good luck.
Let us know how things work out
Web Hosting | Webmaster Help
|

09-06-2005, 10:11 AM
|
 |
WebProWorld Veteran
|
|
Join Date: Jul 2003
Location: Melbourne, Australia
Posts: 541
|
|
I just sent them an email.
Say, I was just thinking.
You know how you go to some websites and you automatically get redirected to a regional version of the site?
Does anyone know how that is done?
Isn't there a meta tag for that?
Maybe I can set a page that redirects Chinese to a page that says:
"Sorry, your region isn't supported."
I'm of to see if there's somthing I can put in the page header. Maybe I can redirect everyone who has a certain charset specified, or somthing? Like maybe I can have a script that detects that the browser is set for Chinese. That way I'm not banning all the english speaking people in China.
MrLeN
|

09-06-2005, 10:21 AM
|
|
WebProWorld Pro
|
|
Join Date: Jun 2004
Location: The Barrens of NE Ohio
Posts: 236
|
|
Why waste the bandwidth serving pages to visitors you don't want to begin with?
Stop the traffic at the firewall. We had to do it because of spam bombs and dictionary attacks on our mail servers.
__________________
:not_the_usual1
[you decide]
________________
All in my opinion, which, when combined carefully with a $1 bill, gets you a cup of coffee at the corner store.
|

09-06-2005, 10:21 AM
|
|
WebProWorld 1,000+ Club
|
|
Join Date: Jul 2003
Location: Toronto, Canada
Posts: 2,193
|
|
I don't think meta tags are gonna do it for re-direction based on ip address. You'll need some kind of script that does an ip lookup that you define.
YOu might want to start your search here
Web Hosting | Webmaster Help
|

09-06-2005, 10:33 AM
|
 |
WebProWorld Veteran
|
|
Join Date: Jul 2003
Location: Melbourne, Australia
Posts: 541
|
|
I was just thinking that maybe IP isn't the best way to go. I'm sure that there are heaps of people in China that speak English and have credit cards. Maybe not per capita, but heaps nonetheless. Therefore I am searching to see if there's some code I can put into the page to detect whether or not the person visiting has their Language set as Chinese.
MrLeN
|

09-06-2005, 10:42 AM
|
 |
WebProWorld Veteran
|
|
Join Date: Jul 2003
Location: Melbourne, Australia
Posts: 541
|
|
I found this Javascript, and I edited it so that all the languages go to the current page, but the Chinese go to Google China :)
I am going to call it lang.js and include it into all my hosting web pages :)
Quote:
<SCRIPT LANGUAGE="JavaScript1.2">
if (navigator.appName == 'Netscape')
var language = navigator.language;
else
var language = navigator.browserLanguage;
if (language.indexOf('en') > -1) document.location.href = '#';
else if (language.indexOf('nl') > -1) document.location.href = '#';
else if (language.indexOf('fr') > -1) document.location.href = '#';
else if (language.indexOf('de') > -1) document.location.href = '#';
else if (language.indexOf('ja') > -1) document.location.href = '#';
else if (language.indexOf('it') > -1) document.location.href = '#';
else if (language.indexOf('pt') > -1) document.location.href = '#';
else if (language.indexOf('es') > -1) document.location.href = '#';
else if (language.indexOf('sv') > -1) document.location.href = '#';
else if (language.indexOf('zh') > -1) document.location.href = 'http://www.google.com/intl/zh-CN/';
else
document.location.href = '#';
</script>
|
..I bet it doesn't work in FireFox.
MrLeN
|

09-06-2005, 10:44 AM
|
 |
WebProWorld Veteran
|
|
Join Date: Jul 2003
Location: Melbourne, Australia
Posts: 541
|
|
Actually, I think this will do:
Code:
<SCRIPT LANGUAGE="JavaScript1.2">
if (navigator.appName == 'Netscape')
var language = navigator.language;
else
var language = navigator.browserLanguage;
if (language.indexOf('en') > -1) document.location.href = '#';
else if (language.indexOf('zh') > -1) document.location.href = 'http://www.google.com/intl/zh-CN/';
else
document.location.href = '#';
</script>
MrLeN
|

09-06-2005, 10:53 AM
|
 |
WebProWorld Veteran
|
|
Join Date: Jul 2003
Location: Melbourne, Australia
Posts: 541
|
|
I have just added it to my two free hosting sites. Now I have t try and find a Chinese person to test it :)
I'll go post in a Chinese forum in English. That'll make me popular lol.
MrLeN
|

09-09-2005, 05:40 AM
|
|
WebProWorld Pro
|
|
Join Date: Sep 2005
Location: Manchester, UK
Posts: 257
|
|
not to insult your plan but have you thought about people disabling javascript?
|

09-09-2005, 12:21 PM
|
 |
WebProWorld Veteran
|
|
Join Date: Jul 2003
Location: Melbourne, Australia
Posts: 541
|
|
Yeah, I was just hoping to get rid of the majority of the visitors. I just looked at my stats. The JavaScript doesn't seem to have made a difference.
I think I should have use Yarascrip
<SCRIP RANGUAGE="Yarascrip1.2">
LOL
Oh well..
Maybe I'll just find a use for them..
Thinking.
MrLeN
|

09-09-2005, 02:15 PM
|
|
WebProWorld Pro
|
|
Join Date: Sep 2005
Location: Manchester, UK
Posts: 257
|
|
Could always appeal to their good nature:
"if you happen to be from china could you be so kind as to not register for this site. please"
maybe not.....
|

09-09-2005, 02:24 PM
|
 |
WebProWorld Veteran
|
|
Join Date: Jul 2003
Location: Melbourne, Australia
Posts: 541
|
|
I am going to have the main page text translated into chinese.
I will have a link that says, "Chinese Here".
And they will be able to better understand what the site is about.
Once they understand, they most likely wont register or promote the site to other chinese.
MrLeN
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|