Php redirect to different urls??

by 6 replies
8
Hi,

I have a site where I do product reviews.

I use a php to redirect....

PHP Code:
<?php header'Location: Amazon.com: Online Shopping for Electronics, Apparel, Computers, Books, DVDs & more' ) ;?>
What I would like to know is if there is a way to set it up so that if the visitor comes from canada it will redirect him to one url and if he comes from us to another url...

Any ideas would be much appriciated! php code? other code? Wordpress Plugin? etc etc

Thanks in advance!

Jute
#programming #php #redirect #urls
  • This may help:
    find county using ip address - PHP

    You need to use geoip

    basically get the ip match it to a country and then create a script to say if it US redirect them to the US amazon site, or if its Canada redirect them to amazon.ca
    • [ 1 ] Thanks
  • MaxMind includes free geoip to country and city database. Haven't used it personally. You can give it shot. Link: MaxMind - GeoIP PHP API
    • [ 1 ] Thanks
    • [1] reply
    • Hi,

      Thanks for your replies.

      I am not a coder so I was looking more for a script or a solution that I could buy and put on my sites....

      Any ideas of where I might find that?

      Thanks

      Jute
      • [1] reply
  • Banned
    [DELETED]

Next Topics on Trending Feed