Hello friends, I'm looking for the right way to redirect according to where the visit came from.
I have this code:
<script>
var result = document.referrer.split( '/' ).indexOf("https://ged-botxtrem.rhcloud.com/");;
if (result >= 0){
alert("Correcto");
} else {
alert("Incorrecto");
location.href = "https://www.google.com/";
}
</script>
He works fine but it turns out that when the url is:
https://ged-botxtrem.rhcloud.com/index.php
Or another variant. That is not just the domain.
Redirects the same as it is not the correct domain.
I hope some help. Thank you.