console.log(document.referrer) if(document.referrer.includes("?url=")){ window.location.href = `/proxy.php?url=https://${(new URL(document.referrer.split("?url=")[1])).hostname}${window.location.pathname}` }else{ // alert("404") window.location.href = "../proxy.php"; }'; } ?>