나는 Maxmind GeoIP2를 얼마 동안 샀고 국가를 기반으로 간단한 리디렉션을하고 싶지만 자신의 웹 사이트에서도이를 수행하는 방법이 명확하지 않습니다. 코딩에 능숙하지는 않지만 어떻게 작동하는지 이해하려고합니다 ...Maxmind를 사용하여 국가에 따라 트래픽을 리디렉션하는 방법 Geoip2 Javascript
예를 들어 제 웹 사이트는 google.com이고 일부 국가는 yahoo.com으로 리디렉션하고 싶습니다. 모두를 yahoo.com으로 리디렉션합니다. 누구든지 나를 도우거나이 스크립트를 재구성하여 목적에 부합되게 만들 수 있습니까? 고마워요 ..
<script src="//js.maxmind.com/js/apis/geoip2/v2.1/geoip2.js" type="text/javascript"></script>
<script language="JavaScript">
var user_country = geoip2.country(
function (response) {
if (response.country.iso_code === "FR"){window.location = "http://yahoo.com"}
else {window.location = "http://google.com"}
if (response.country.iso_code === "BE"){window.location = "http://yahoo.com"}
else {window.location = "http://google.com"}
if (response.country.iso_code === "PH"){window.location = "http://yahoo.com"}
else {window.location = "http://google.com"}
},
function (error) {
// handle error
}
);
</script>
당신이 봤어 [MaxMind의 재 튜토리얼] (http://dev.maxmind.com/geoip/geoip2/javascript/tutorial/#Redirect_Users_to_a_Country-Specific_Site)? –