С использованием jquery
$.get(«ipinfo.io», function (response) { if(response.country == 'RU') window.location.href = 'http://google.ru'; }, «jsonp»);