4 replies [Last post]
pwog
Offline
Joined: 08/27/2010

Hi,

I would like to know how to do the following:

If someone from the UK does a search in Google.com, and clicks on the link to come to my .com, I detect their IP address is UK based before serving them content, and redirect them to the page they requested on my co.uk domain.

Any help would be appreciated.

Thanks,
Paul

pearsoneg
Offline
Joined: 12/16/2009
Here is a good explanation of

Here is a good explanation of the relationship between IPs and location:

http://whatismyipaddress.com/find-me

I haven't done this myself, but here are the likely steps:

1. Identity the IP address of incoming http requests
2. Use a 3rd party web service (or create your own ip/country lookup table) to id the country of origin
3. Then send the appropriate web site back to the requestor.

Erik Pearson

pearsoneg
Offline
Joined: 12/16/2009
Cookies

You could instead use a cookie to keep track of which site they choose to use (after asking them to id their country of origin when they first visit your page).

Erik Pearson

pwog
Offline
Joined: 08/27/2010
Thanks, Erik. HAve you ever

Thanks, Erik. HAve you ever seen this application? http://www.maxmind.com/app/mod_geoip

It seems that I could use this and then just use one of the supplied APIs to redirect the user to the proper site. Does that sound correct?

Paul

pearsoneg
Offline
Joined: 12/16/2009
Haven't seen that one, but

Haven't seen that one, but something like that should work. It looks like it's for Apache, but if you are using a different server, I'm sure there is a similar mod for whatever server you are using.

Erik