Contact Us Forum Rules Search Archive
WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-04-2005, 12:53 AM
MrLeN's Avatar
WebProWorld Veteran
 

Join Date: Jul 2003
Location: Melbourne, Australia
Posts: 541
MrLeN RepRank 0
Default 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
Reply With Quote
  #2 (permalink)  
Old 09-04-2005, 01:04 AM
WebProWorld 1,000+ Club
 

Join Date: Jul 2003
Location: Toronto, Canada
Posts: 2,193
cyanide RepRank 0
Default

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
Reply With Quote
  #3 (permalink)  
Old 09-04-2005, 01:57 AM
MrLeN's Avatar
WebProWorld Veteran
 

Join Date: Jul 2003
Location: Melbourne, Australia
Posts: 541
MrLeN RepRank 0
Default

Ok, sounds good so far :)

Um, .. how do I ad them to my firewall rules?

MrLeN
Reply With Quote
  #4 (permalink)  
Old 09-06-2005, 01:57 AM
WebProWorld Pro
 

Join Date: Jun 2004
Location: The Barrens of NE Ohio
Posts: 236
nottheusual1 RepRank 0
Default

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.
Reply With Quote
  #5 (permalink)  
Old 09-06-2005, 02:00 AM
MrLeN's Avatar
WebProWorld Veteran
 

Join Date: Jul 2003
Location: Melbourne, Australia
Posts: 541
MrLeN RepRank 0
Default

Thanks mate.

MrLeN
Reply With Quote
  #6 (permalink)  
Old 09-06-2005, 08:34 AM
WebProWorld 1,000+ Club
 

Join Date: Jul 2003
Location: Toronto, Canada
Posts: 2,193
cyanide RepRank 0
Default

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
Code:
apf -d xx.xxx.x.xx



Web Hosting | Webmaster Help
Reply With Quote
  #7 (permalink)  
Old 09-06-2005, 08:43 AM
MrLeN's Avatar
WebProWorld Veteran
 

Join Date: Jul 2003
Location: Melbourne, Australia
Posts: 541
MrLeN RepRank 0
Default

Sorry, I don't know anything about server firewalls. Are you suggesting that there's a firewall on my server?

MrLeN
Reply With Quote
  #8 (permalink)  
Old 09-06-2005, 09:42 AM
WebProWorld 1,000+ Club
 

Join Date: Jul 2003
Location: Toronto, Canada
Posts: 2,193
cyanide RepRank 0
Default

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
Reply With Quote
  #9 (permalink)  
Old 09-06-2005, 09:45 AM
MrLeN's Avatar
WebProWorld Veteran
 

Join Date: Jul 2003
Location: Melbourne, Australia
Posts: 541
MrLeN RepRank 0
Default

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
Reply With Quote
  #10 (permalink)  
Old 09-06-2005, 09:52 AM
WebProWorld 1,000+ Club
 

Join Date: Jul 2003
Location: Toronto, Canada
Posts: 2,193
cyanide RepRank 0
Default

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
Reply With Quote
  #11 (permalink)  
Old 09-06-2005, 09:58 AM
MrLeN's Avatar
WebProWorld Veteran
 

Join Date: Jul 2003
Location: Melbourne, Australia
Posts: 541
MrLeN RepRank 0
Default

okies, that sounds easier.

Will do :)

Thanks for your help.

MrLeN
Reply With Quote
  #12 (permalink)  
Old 09-06-2005, 10:00 AM
WebProWorld 1,000+ Club
 

Join Date: Jul 2003
Location: Toronto, Canada
Posts: 2,193
cyanide RepRank 0
Default

no problem, good luck.
Let us know how things work out



Web Hosting | Webmaster Help
Reply With Quote
  #13 (permalink)  
Old 09-06-2005, 10:11 AM
MrLeN's Avatar
WebProWorld Veteran
 

Join Date: Jul 2003
Location: Melbourne, Australia
Posts: 541
MrLeN RepRank 0
Default

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
Reply With Quote
  #14 (permalink)  
Old 09-06-2005, 10:21 AM
WebProWorld Pro
 

Join Date: Jun 2004
Location: The Barrens of NE Ohio
Posts: 236
nottheusual1 RepRank 0
Default

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.
Reply With Quote
  #15 (permalink)  
Old 09-06-2005, 10:21 AM
WebProWorld 1,000+ Club
 

Join Date: Jul 2003
Location: Toronto, Canada
Posts: 2,193
cyanide RepRank 0
Default

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
Reply With Quote
  #16 (permalink)  
Old 09-06-2005, 10:33 AM
MrLeN's Avatar
WebProWorld Veteran
 

Join Date: Jul 2003
Location: Melbourne, Australia
Posts: 541
MrLeN RepRank 0
Default

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
Reply With Quote
  #17 (permalink)  
Old 09-06-2005, 10:42 AM
MrLeN's Avatar
WebProWorld Veteran
 

Join Date: Jul 2003
Location: Melbourne, Australia
Posts: 541
MrLeN RepRank 0
Default

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
Reply With Quote
  #18 (permalink)  
Old 09-06-2005, 10:44 AM
MrLeN's Avatar
WebProWorld Veteran
 

Join Date: Jul 2003
Location: Melbourne, Australia
Posts: 541
MrLeN RepRank 0
Default

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
Reply With Quote
  #19 (permalink)  
Old 09-06-2005, 10:53 AM
MrLeN's Avatar
WebProWorld Veteran
 

Join Date: Jul 2003
Location: Melbourne, Australia
Posts: 541
MrLeN RepRank 0
Default

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
Reply With Quote
  #20 (permalink)  
Old 09-09-2005, 05:40 AM
WebProWorld Pro
 

Join Date: Sep 2005
Location: Manchester, UK
Posts: 257
mikesmith76 RepRank 0
Default

not to insult your plan but have you thought about people disabling javascript?
Reply With Quote
  #21 (permalink)  
Old 09-09-2005, 12:21 PM
MrLeN's Avatar
WebProWorld Veteran
 

Join Date: Jul 2003
Location: Melbourne, Australia
Posts: 541
MrLeN RepRank 0
Default

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
Reply With Quote
  #22 (permalink)  
Old 09-09-2005, 02:15 PM
WebProWorld Pro
 

Join Date: Sep 2005
Location: Manchester, UK
Posts: 257
mikesmith76 RepRank 0
Default

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.....
Reply With Quote
  #23 (permalink)  
Old 09-09-2005, 02:24 PM
MrLeN's Avatar
WebProWorld Veteran
 

Join Date: Jul 2003
Location: Melbourne, Australia
Posts: 541
MrLeN RepRank 0
Default

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
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Tags: ,



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On