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

4 replies
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
#autoredirect #based #configure #country #ecommerce
  • Profile picture of the author Chris Reeves
    Originally Posted by jskarthik1 View Post

    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
    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!
    {{ DiscussionBoard.errors[6733841].message }}
  • Profile picture of the author chrislim2888
    You can check this website for free service in getting the country based on visitor IP and make your own re-direction -> ipinfodb.
    {{ DiscussionBoard.errors[6746994].message }}
    • Profile picture of the author CMGbz
      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;
      }
      ?>
      {{ DiscussionBoard.errors[6881188].message }}
      • Profile picture of the author The Real Deal
        I don't want to post my script here since I am using some "honey traps" and stuff I would rather not share, but I use the MaxMind database for the geotargeting and it's pretty good. They also offer proxy identification which is pretty nice.

        I am sure that MaxMind also has scripts and maybe even full-service solutions that you can use.



        Edit: Just realized that this post is like a month old!
        {{ DiscussionBoard.errors[6881606].message }}

Trending Topics