我希望根据访问者的 ip 重定向 url,我有以下代码,经过测试,但它总是去 AU,如果条件不起作用,请帮助,非常感谢...
<script language="JavaScript" src="http://www.geoplugin.net/javascript.gp" type="text/javascript"></script>
<script language="Javascript">
var mylocation=geoplugin_countryCode();
if (mylocation=="AU") {
window.location.href='http://www.propertyhere.com/Country/AU/search-to-buy'},
else if (mylocation=="CA") {
window.location.href='http://www.propertyhere.com/Country/CA/search-to-buy'},
else if (mylocation=="CN") {
window.location.href='http://www.propertyhere.com/Country/CN/search-to-buy'},
else if (mylocation=="NZ") {
window.location.href='http://www.propertyhere.com/Country/NZ/search-to-buy'},
else if (mylocation=="RU") {
window.location.href='http://www.propertyhere.com/Country/RU/search-to-buy'},
else if (mylocation=="US") {
window.location.href='http://www.propertyhere.com/Country/US/search-to-buy'},
else if {
window.location.href='http://www.propertyhere.com/network'},
</script>