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

ip address location Products

Contact us Contact us
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 :

  • 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:;

  • 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"]=""

  • To test and debug , poin your browser to
    When you are satisfied, set _DEBUG_MODE to 0.
    You must edit cr/cr.php and modify it.

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