How to configure Country IP based auto-redirect for E-Commerce?

by 4 replies
6
Does anybody know how to redirect users coming from different countries (through search engines mostly) to country-specific store sections of an e-commerce website ?

Please share if you know any script/code that will help to achieve this Geo-ip based automatic redirect.

Thanks
#main internet marketing discussion forum #autoredirect #based #configure #country #ecommerce
  • Haven't personally done this but there seem to be plenty of options popping up in a Google search. There's a thread here on the WF where someone seemed to find what you're looking for.

    Good luck!
    • [ 1 ] Thanks
  • You can check this website for free service in getting the country based on visitor IP and make your own re-direction -> ipinfodb.
    • [1] reply
    • Here is the one we use:

      (Save http://geoplugin.com/_media/webservi...gin.class.phps as geoplugin.class.php and store in the same /dir)

      Code:
      <?php
      // redirect by IP country code
      require_once('geoplugin.class.php');
       = new geoPlugin();
      ();
       = ;
      switch() {
      case 'US':
      header('Location: http://www.google.com');
      exit;
      case 'CA':
      header('Location: http://www.google.ca');
      exit;
      case 'GB':
      header('Location: http://www.google.co.uk');
      exit;
      case 'IE':
      header('Location: http://www.google.ie');
      exit;
      case 'NL':
      header('Location: http://www.google.nl');
      exit;
      case 'AU':
      header('Location: http://www.google.au');
      exit;
      case 'NZ':
      header('Location: http://www.google.nz');
      exit;
      default: // exceptions
      header('Location: http://www.yahoo.com');
      exit;
      }
      ?>
      • [1] reply

Next Topics on Trending Feed