Yeah make sure mod_geoip is installed and working
Yeah make sure mod_geoip is installed and working
You would need to get someone with php experience to get this to read the geoip file so it doesnt work as is
I never used it but its a possible fix if completed.Code:<?php $block = array('US','IQ','NG','IR','SA','AG','MY','ID','CL','KW','AE'); if (in_array($_SERVER['GEOIP_COUNTRY_CODE'], $block)) { header("Location: http://centurian.org"); exit; } ?>
Reverse IP Check ಠ_ಠ Proxy Sites
<?php if ($youask == 'stupid question') { echo ('stupid answer'); } ?>
Thanks for helping me out, though I'll keep it like it is now... the block worked, but it isn't redirecting
I'll do it once I have my new server
Greetz
|Nico Lawsons - Quality Web Hosting at WiredStorm
|cPanel with Softaculous and 24/7 Email (Ticket) Support & Live Chat
Does anyone know if this fix works with glype ?
If it doesn't does anyone know how I can redirect traffic using glype ?
Thanks,![]()
the code given will work on any site or script. Since its in htaccess.
Reverse IP Check ಠ_ಠ Proxy Sites
<?php if ($youask == 'stupid question') { echo ('stupid answer'); } ?>
A better way to use GeoIP is as follows.
This method works very well with glype but would need a bit of work for PHProxy.
You can put the following php code at the top of your index.php file and change $badcountry to the countries you want to redirect.
First you have to download the follow.
This is by Geolocation and Online Fraud Prevention from MaxMind
Download this
http://geolite.maxmind.com/download/...y/GeoIP.dat.gz - must be deflated with 7-Zip or similar program.
http://geolite.maxmind.com/download/.../php/geoip.inc
and use this PHP to interact with it.
Interact using this php code in your index.php.
<?php
// PUT THIS CODE AT THE TOP OF YOUR INDEX.PHP BEFORE ANYTHING ELSE
include('geoip/geoip.inc'); //this file must exist in your directory
// Uncomment if querying against GeoIP/Lite City.
// include('geoip/geoip.inc');
$gi = geoip_open('geoip/geoip.dat',GEOIP_STANDARD);
// get the ip of the visitor
$addr = getenv('REMOTE_ADDR');
// translate his ip to a country code
$country = geoip_country_name_by_addr($gi, $addr);
// close the geo database
geoip_close($gi);
$badcountry = array('Example','Example','Example','Example');
// redirect them if they suck
if(in_array($country, $badcountry))
header('Location: Example Web Page'); //enter a url or page on your site
?>
In the header('Location field put the site you want to redirect your $badcountry to.
Hope this helps.. If you need it for phproxy I can try and help further.
Aquarezz (19 March, 2009), strat (23 March, 2009), WebEvader (19 March, 2009), Will.Spencer (20 March, 2009), Zash (20 May, 2009)
who ever does not want china traffic you can redirect it to me.. PM me
I am after china traffic
Bookmarks