Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar Mark Forums Read
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 08-29-2008, 01:41 PM   #1
RayBonga
too cool for highschool
 
RayBonga's Avatar
 
Join Date: Nov 2005
Location: East side, West side, Worldwide!
Posts: 12,164
How to ban some countries from our sites

How do you redirect users from Nigeria, China, India, etc. to some alternative site/page?

I'm gussing I should just create some htacecss file but not sure how to do it
RayBonga is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-29-2008, 03:19 PM   #2
tiger
Confirmed User
 
tiger's Avatar
 
Industry Role:
Join Date: Apr 2002
Location: Los Angeles
Posts: 6,986
Add Turkey to your list as well when you find out how.
__________________

tiger is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-29-2008, 03:30 PM   #3
directfiesta
Too lazy to set a custom title
 
directfiesta's Avatar
 
Industry Role:
Join Date: Oct 2002
Location: Montreal, Quebec
Posts: 29,667
Quote:
Originally Posted by tiger View Post
Add Turkey to your list as well when you find out how.
agreed ...

If you have a dedicated box, you can block whole countries thru the firewall ( not redirecting it to another page ).

Otherwise. .htaccess with the whole range of IP would do it ( including redirecting ).

IP of countries here
__________________
I know that Asspimple is stoopid ... As he says, it is a FACT !

But I can't figure out how he can breathe or type , at the same time ....
directfiesta is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-29-2008, 03:34 PM   #4
ukxtra
Confirmed User
 
ukxtra's Avatar
 
Join Date: Jan 2003
Posts: 844
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^CN$ [NC,OR]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^HK$ [NC,OR]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^MO$ [NC,OR]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^CN$ [NC,OR]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^HK$ [NC,OR]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^MO$ [NC,OR]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^MY$ [NC,OR]
RewriteRule ^(.*)$ http://www.yoursite.com/whatever.html [R,L]

or

<SCRIPT language="JavaScript">
ban = new Array('ad','ae','af','ag','ai','al','am','an','ao' ,'aq','ar','as','at','aw','ax','az','ba','bb','bd' ,'be','bf','bg','bh','bi','bj','bn','bo','br','bt' ,'bv','bw','by','bz','cc','cd','cf','cg','ch','ci' ,'ck','cl','cm','cn','co','cr','cs','cu','cv','cx' ,'cy','cz','dj','dm','do','dz','ec','ee','eg','eh' ,'er','es','et','fi','fj','fk','fm','fo','fr','fx' ,'ga','gd','ge','gf','gh','gl','gm','gn','gp','gq' ,'gr','gs','gt','gu','gw','gy','hk','hm','hn','hr' ,'ht','hu','id','il','in','io','iq','ir','is','it' ,'jm','jo','jp','ke','kg','kh','ki','km','kn','kp' ,'kr','kw','ky','kz','la','lb','lc','li','lk','lr' ,'ls','lt','lu','lv','ly','ma','mc','md','mg','mh' ,'mk','ml','mm','mn','mo','mp','mq','mr','ms','mt' ,'mu','mv','mw','mx','my','mz','na','nc','ne','nf' ,'ng','ni','nl','no','np','nr','nu','nz','om','pa' ,'pe','pf','pg','ph','pk','pl','pm','pn','pr','ps' ,'pt','pw','py','qa','re','ro','ru','rw','sa','sb' ,'sc','sd','se','sg','sh','si','sj','sk','sl','sm' ,'sn','so','sr','st','su','sv','sy','sz','tc','td' ,'tf','tg','th','tj','tk','tl','tm','tn','to','tp' ,'tr','tt','tv','tw','tz','ua','ug','uy','uz','va' ,'vc','ve','vg','vi','vn','vu','wf','ws','ye','yt' ,'yu','za','zm','zr','zw','edu','gov','mil','nato' );
for(i in ban){
if(navigator.userLanguage.indexOf(ban[i]) >=0){document.location.href="http://www.YOURSITE.com";}
}
</SCRIPT>
ukxtra is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-29-2008, 03:57 PM   #5
Mr Pheer
Retired
 
Mr Pheer's Avatar
 
Industry Role:
Join Date: Dec 2002
Posts: 21,245
Quote:
Originally Posted by ukxtra View Post
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^CN$ [NC,OR]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^HK$ [NC,OR]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^MO$ [NC,OR]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^CN$ [NC,OR]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^HK$ [NC,OR]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^MO$ [NC,OR]
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^MY$ [NC,OR]
RewriteRule ^(.*)$ http://www.yoursite.com/whatever.html [R,L]
is there another part to this? where does it get the geoip country code?
__________________
2 lifeguards for Jessica
Mr Pheer is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-29-2008, 04:25 PM   #6
ukxtra
Confirmed User
 
ukxtra's Avatar
 
Join Date: Jan 2003
Posts: 844
TBH not sure MrPheer, got it from here but not tried it. The JS one works fine though

Quote:
Originally Posted by pocketkangaroo View Post
Always wondered what would happen if a bunch of big porn sites got together and did something like this for a couple days.

PHP Code:
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^CN$ [NC,OR] 
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^HK$ [NC,OR] 
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^MO$ [NC,OR] 
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^CN$ [NC,OR] 
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^HK$ [NC,OR] 
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^MO$ [NC,OR] 
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^MY$ [NC,OR] 
RewriteRule ^(.*)$ http://www.tubesite.com/longest-video-on-site.html [R,L] 
ukxtra is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-29-2008, 06:23 PM   #7
Mr Pheer
Retired
 
Mr Pheer's Avatar
 
Industry Role:
Join Date: Dec 2002
Posts: 21,245
ok.. thanks
__________________
2 lifeguards for Jessica
Mr Pheer is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks
Thread Tools



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.