Hello, Can some one help me please - I would much appreciate it. Lets say for example, I have a product for sale on a store in the UK (1st URL), and a Product for sale in a store in the US (2nd URL). They are both the same site, but are under two different URLs. Is it possible, to create a single URL, which would direct the person who clicks it to the appropriate URL based on their location? Any advice would be appreciated.
What cart system are you using? That sounds a tad vexing but geo ip stuff is not so bad really. It would make more sense to have a .co.uk version of the site .com version etc. it becomes a bit more complex when you have both on one domain. Nigel
Thanks for your reply I use wordpress.com. Not sure how to install plugins on that. The products I was referring to are on amazon.co.uk and amazon.com, I have no control over these domains. I simply want to create links, which I can put on my social media sites, which will redirect users based on their location.
That redirection would in theory get handled on amazons end off the top of my head. I dont think you push basically, there is no inherent detection going on until the amazon server is pinged. But, if you have a hard link to a .com that is where the visitor is going. What happens later is out of your control I would imagine. Nigel
Quite hard for me to understand, but yes I only have .com or .co.uk links. Do you think they could provide me links which redirect?
http://www.kboards.com/index.php?action=printpage;topic=159406.0 There is a discussion about this there. I have to run out for a sec so I am not entirely focused but it seems to me amazon is probably already doing this anyway. If I click a .co.uk link I would think amazon will throw me to the US iteration of the site since that is where I am. This may be a non issue. Nigel
For some reason Amazon don't. I am in the UK if I click on a .com link it takes me to the .com store.
It is totally possible. There will be different ways to do it depending on what type of site it is. You can use a free GEOIP database (there is one by company called maxmind) and check where the user is viewing from. Then its just a matter of doing a 302 header redirect to the right url depending on the location. If you are running apache with mod_geoip (or if your host supports that) then its even easier, check this thread out http://stackoverflow.com/questions/9838344/how-to-redirect-domain-according-to-country-ip-address Good luck!
Hello, Sorry I do not have a host, I want to use these links on social media sites, e.g. Twitter and Facebook.
Save the code below as a php file and change the top part with the URLs you want then link to that php file. <?PHP //Change the values below $usa = "http://usa.com"; $uk = "http://uk.com"; $others = "http://nepal.com"; function visitor_country() { $client = @$_SERVER['HTTP_CLIENT_IP']; $forward = @$_SERVER['HTTP_X_FORWARDED_FOR']; $remote = $_SERVER['REMOTE_ADDR']; $result = "Unknown"; if(filter_var($client, FILTER_VALIDATE_IP)) { $ip = $client; } elseif(filter_var($forward, FILTER_VALIDATE_IP)) { $ip = $forward; } else { $ip = $remote; } $ip_data = @json_decode(file_get_contents("http://www.geoplugin.net/json.gp?ip=".$ip)); if($ip_data && $ip_data->geoplugin_countryName != null) { $result = $ip_data->geoplugin_countryName; } return $result; } $loc = visitor_country(); if($loc == "United States"){ header("Location: $usa"); }elseif($loc == "United Kingdom"){ header("Location: $uk"); }else{ header("Location: $others"); } ?> PHP: It uses free geoip database from geoplugin.net. Let me know if it works.
I don't think he is listening but, in all fairness, I thought you were running an affiliate site as well. Nigel
Sorry forgot to mention, get a free web host that supports php and save this file there. I don't know if any other websites that provide this kind of service so looks like you will have to use your own.