I have www.propertyhere.com
I want to insert some Jquery code in the index page to redirect visitor into the following pages according to their geographical ip location.
if user ip is from AU then show:
http://www.propertyhere.com/Country/AU/search-to-buy;
if user ip is from CA then show:
http://www.propertyhere.com/Country/CA/search-to-buy;
if user ip is from NZ then show:
http://www.propertyhere.com/Country/NZ/search-to-buy;
if user ip is from US then show:
http://www.propertyhere.com/Country/US/search-to-buy;
if user ip is from CN then show:
http://www.propertyhere.com/Country/CN/search-to-buy;
if user ip is from RU then show:
http://www.propertyhere.com/Country/RU/search-to-buy;
If visitor's ip doesn't match the above locations then just let the visitor stay in the homepage.
You could use a service such as http://geoiplookup.wikimedia.org/ and do a simple ajax request. This should grant you all the necessary details.
dome thing like this may help:
$.ajax('http://geoiplookup.wikimedia.org/', {
crossDomain:true,
success:function(data,text,xhqr){
alert(data);
},
error:function(xhr, textStatus){
alert(xhr.responseText);
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With