![]() |
![]() |
![]() |
||||
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. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Industry Role:
Join Date: Nov 2009
Location: Heaven
Posts: 4,306
|
Redirect Your traffic from specific countries.
Okie, i was getting traffic from malaysia and site was using full resources of cpu so host told me to do something about it.,
so i used this Code:
<script src="http://www.geoplugin.net/javascript.gp" type="text/javascript"></script> <script type="text/javascript"> switch(geoplugin_countryCode()){ case "MY" : document.location.href = "http://www.xxxtreme.com/blocked.html"; break; } </script> </head> thanks to you all for all ur useless reply's j/k. GFY.. not kidding. ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Please dont fuck animals
Industry Role:
Join Date: Jul 2010
Location: Henderson, NV
Posts: 3,988
|
Its better to use php and redirect them from there before your html page even loads. You can still do it for free, maxmind gives away the database for it and even tells you how to do it on their website.
__________________
![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
It's 42
Industry Role:
Join Date: Jun 2010
Location: Global
Posts: 18,083
|
This does? Count/convert the money in my wallet? Code:
function geoplugin_city() { return '**';} function geoplugin_region() { return '**';} function geoplugin_regionCode() { return '**';} function geoplugin_regionName() { return '**';} function geoplugin_areaCode() { return '**';} function geoplugin_dmaCode() { return '**';} function geoplugin_countryCode() { return 'US';} function geoplugin_countryName() { return 'United States';} function geoplugin_continentCode() { return 'NA';} function geoplugin_latitude() { return '42.**';} function geoplugin_longitude() { return '-83.**';} function geoplugin_currencyCode() { return 'USD';} function geoplugin_currencySymbol() { return '$';} function geoplugin_currencyConverter(amt, symbol) { if (!amt) { return false; } var converted = amt * 1; if (converted <0) { return false; } if (symbol === false) { return Math.round(converted * 100)/100; } else { return '$'+(Math.round(converted * 100)/100);} return false; } The ** were omitted but the values were close |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
So Fucking Banned
Industry Role:
Join Date: Apr 2011
Posts: 1,241
|
Interesting. I'll take it.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
It's 42
Industry Role:
Join Date: Jun 2010
Location: Global
Posts: 18,083
|
Just add these to the root .htaccess file Code:
<Files 403.shtml> order allow,deny allow from all </Files> #then all the malaysia ips on the above URL This not stopping the traffic to the server but the IPs will get a 403 - Forbidden 57 bytes? |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 | |
Confirmed User
Industry Role:
Join Date: Nov 2009
Location: Heaven
Posts: 4,306
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 | |
Confirmed User
Industry Role:
Join Date: Nov 2009
Location: Heaven
Posts: 4,306
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
It's 42
Industry Role:
Join Date: Jun 2010
Location: Global
Posts: 18,083
|
http://www.geoplugin.net/javascript.gp run your script in a browser its looks like a currency converter ... |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 | |
Confirmed User
Industry Role:
Join Date: Nov 2009
Location: Heaven
Posts: 4,306
|
Quote:
but what it does is give the country code., and then i use switch(geoplugin_countryCode()){ case "MY" : document.location.href = "http://www.xxxtreme.com/blocked.html"; break; to check if the country code is MY , and then it redirects it to given url. thanks for your time. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 |
It's 42
Industry Role:
Join Date: Jun 2010
Location: Global
Posts: 18,083
|
OK that is one way to do it ... |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 | |
Confirmed User
Industry Role:
Join Date: Nov 2009
Location: Heaven
Posts: 4,306
|
Quote:
anyways i just checked server stats and memory usage are overheating.., i guess traffic coming to the index.php and then redirecting also causing issues...so i m gonna try 403 htaccess method. will c if server resource goes down. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |