Ich benutze eine PHP-Datei mit einem Skript darin, um 1 URL zu verschiedenen URLs basierend auf dem Benutzerstandort umzuleiten, aber die es bleibt stecken. einfach nicht umleiten. die Sache ist - es bis gestern aufgearbeitet ...Meine PHP URL wird nicht umgeleitet
<!DOCTYPE html>
<html>
<head>
<script language="Javascript" src="http://gd.geobytes.com/gd?after=-1&variables=GeobytesLocationCode,GeobytesCode,GeobytesInternet">
</script>
<script>
function redirect(){
var sub= getSub();
var country= sGeobytesInternet;
if(country == "BE"){window.location = "http://sitelink1.com/?subid="+sub}
else if(country == "FR"){window.location = "http://sitelink2.com/?subid="+sub}
else if(country == "DE"){window.location = "http://sitelink3.com/?subid="+sub}
else if(country == "AT"){window.location = "http://sitelink4.com/?subid="+sub}
else if(country == "CH"){window.location = "http://sitelink5.com/?subid="+sub}
else if(country == "US"){window.location = "http://sitelink6.com/?subid="+sub}
else if(country == "PT"){window.location = "http://sitelink7.com/?subid="+sub}
else if(country == "BG"){window.location = "http://sitelink8.com/?subid="+sub}
else if(country == "HU"){window.location = "http://sitelink9.com/?subid="+sub}
else if(country == "PL"){window.location = "http://sitelink10.com/?subid="+sub}
else if(country == "SK"){window.location = "http://sitelink11.com/?subid="+sub}
else if(country == "IT"){window.location = "http://sitelink12.com/?subid="+sub}
else {window.location = ""+sub}
}
function getSub(){
regex = /subid=([\w-]*)/;
url =window.location.href;
if(-1 != url.indexOf("subid")){
var id = url.match(regex)[1];
return id;
}else{
return '';
}
}
redirect()
</script>
</head>
<body>
</body>
</html>
Es gibt einige Probleme mit Ihrer URL: http://gd.geobytes.com/gd?after=-1&variables=GeobytesLocationCode,GeobytesCode,GeobytesInternet. Ich habe versucht, es zu öffnen, aber es ist derzeit nicht verfügbar. –
Ich habe meine Antwort aktualisiert. Sie können eine kleine Probe versuchen. Ich habe einen anderen GeoIP-Provider verwendet. Es wird gut für dich arbeiten. –