Blocking visitors by country using PHP & MySQL - Geo-targeting Redirection software

ip address location Products

Contact us Contact us
FAQ F.A.Q.
Purchase Purchase
Downloads Downloads
Contact us Contact us

IP Address Locator
IP Geolocation Articles & Tutorial (Free)

Install Target Country by IP Address

If you want to restrict access to visitors from YY country,Or you want to block a whole lot of countries. But make exceptions for ip addresses (eg: your IP Adress).
  • Add the next line at the beginning of EVERY PAGE YOU NEED TO REDIRECT VISITORS
  • <?PHP $anp_path="cr/"; include($anp_path."cr.php"); ?>

    or (if cr/ directory is a level up)

    <?PHP $anp_path="../cr/"; include($anp_path."cr.php"); ?>

  • Edit cr/cr.php ,You must set :
    $anp_default_reject_link="";
    $anp_default_redirect_link="";

  • You can add the IP address or the network`s IP range in the cr/exceptions_ips.dat file in order for the visitors to be able to visit your website. Exemple:
    209.92.145.14
    209.92.130.1;209.92.139.255

  • edit the Redirection Rules file(cur_re_rules.php), for country YY uncomment the line and place an invalid url for it (YY=404.php)
  • $anp_rr["YY"]="http://www.yahoo.com"

  • To test and debug , poin your browser to http://www.yourdomain.com
    When you are satisfied, set _DEBUG_MODE to 0.
    You must edit cr/cr.php and modify it.
    define("_DEBUG_MODE","0");

Copyright ©2001-2017 Jgsoft Associates. All rights reserved.