GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   How to ban some countries from our sites (https://gfy.com/showthread.php?t=851385)

RayBonga 08-29-2008 01:41 PM

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

tiger 08-29-2008 03:19 PM

Add Turkey to your list as well when you find out how.

directfiesta 08-29-2008 03:30 PM

Quote:

Originally Posted by tiger (Post 14684523)
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

ukxtra 08-29-2008 03:34 PM

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>

Mr Pheer 08-29-2008 03:57 PM

Quote:

Originally Posted by ukxtra (Post 14684593)
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?

ukxtra 08-29-2008 04:25 PM

TBH not sure MrPheer, got it from here but not tried it. The JS one works fine though

Quote:

Originally Posted by pocketkangaroo (Post 14474731)
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] 



Mr Pheer 08-29-2008 06:23 PM

ok.. thanks :)


All times are GMT -7. The time now is 01:40 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123