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
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 06-03-2011, 11:58 PM   #1
cooldude7
Confirmed User
 
cooldude7's Avatar
 
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>
will c how it goes.

thanks to you all for all ur useless reply's j/k. GFY.. not kidding.
cooldude7 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-04-2011, 12:07 AM   #2
Seth Manson
Please dont fuck animals
 
Seth Manson's Avatar
 
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.
__________________
Seth Manson is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-04-2011, 12:10 AM   #3
Barry-xlovecam
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

Last edited by Barry-xlovecam; 06-04-2011 at 12:12 AM..
Barry-xlovecam is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-04-2011, 12:20 AM   #4
ThatOtherGuy - BANNED FOR LIFE
So Fucking Banned
 
Industry Role:
Join Date: Apr 2011
Posts: 1,241
Interesting. I'll take it.
ThatOtherGuy - BANNED FOR LIFE is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-04-2011, 12:32 AM   #5
Barry-xlovecam
It's 42
 
Industry Role:
Join Date: Jun 2010
Location: Global
Posts: 18,083
Just add these to the root .htaccess file

http://www.ipdeny.com/ipblocks/data/countries/my.zone

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?

Blocking entire countries is best done with mod_geoip for Apache2 (Debian) Google for mod_geoip
Barry-xlovecam is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-04-2011, 12:35 AM   #6
cooldude7
Confirmed User
 
cooldude7's Avatar
 
Industry Role:
Join Date: Nov 2009
Location: Heaven
Posts: 4,306
Quote:
Originally Posted by Barry-xlovecam View Post
Just add these to the root .htaccess file

http://www.ipdeny.com/ipblocks/data/countries/my.zone

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?

Blocking entire countries is best done with mod_geoip for Apache2 (Debian) Google for mod_geoip
i dont want surfers to view some 403 error, i wanna give them specific reason ....
cooldude7 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-04-2011, 12:36 AM   #7
cooldude7
Confirmed User
 
cooldude7's Avatar
 
Industry Role:
Join Date: Nov 2009
Location: Heaven
Posts: 4,306
Quote:
Originally Posted by Barry-xlovecam View Post
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
i dont get it , what are u saying ??
cooldude7 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-04-2011, 01:07 AM   #8
Barry-xlovecam
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 ...

it doesnt do anything

if function geoplugin_countryCode() {return MY} then?

if (!amt) { return false; } amt is the amount from the shopping cart?

Where did you find this?


Edit: From here http://www.geoplugin.com/quickstart

this does not redirect or block with geo-ip

Last edited by Barry-xlovecam; 06-04-2011 at 01:14 AM..
Barry-xlovecam is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-04-2011, 02:06 AM   #9
cooldude7
Confirmed User
 
cooldude7's Avatar
 
Industry Role:
Join Date: Nov 2009
Location: Heaven
Posts: 4,306
Quote:
Originally Posted by Barry-xlovecam View Post
http://www.geoplugin.net/javascript.gp run your script in a browser its looks like a currency converter ...

it doesnt do anything

if function geoplugin_countryCode() {return MY} then?

if (!amt) { return false; } amt is the amount from the shopping cart?

Where did you find this?


Edit: From here http://www.geoplugin.com/quickstart

this does not redirect or block with geo-ip
lol, thanks for the info.,

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.
cooldude7 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-04-2011, 02:25 AM   #10
Barry-xlovecam
It's 42
 
Industry Role:
Join Date: Jun 2010
Location: Global
Posts: 18,083
OK that is one way to do it ...
"Visitors from this country are currently blocked, Sorry for the inconvenience. " LOL that is better?

Should work ...

You only posted part of the code ...

The difference is the server resource usage.
I don't like using services they have a way of disappearing or starting to charge for services. Better to run this sort of thing yourself IMHO.
Barry-xlovecam is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-04-2011, 05:15 AM   #11
cooldude7
Confirmed User
 
cooldude7's Avatar
 
Industry Role:
Join Date: Nov 2009
Location: Heaven
Posts: 4,306
Quote:
Originally Posted by Barry-xlovecam View Post
OK that is one way to do it ...
"Visitors from this country are currently blocked, Sorry for the inconvenience. " LOL that is better?

Should work ...

You only posted part of the code ...

The difference is the server resource usage.
I don't like using services they have a way of disappearing or starting to charge for services. Better to run this sort of thing yourself IMHO.
i posted the complete code in my 1st post,

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.
cooldude7 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



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.