0
In Javascript, we can check if the url is different, we have window.location.href
You can do it:
var urlAtual = window.location.href;
var urlCadastro = "www.teste.com/cadastro";
if(urlAtual != urlCadastro){
window.location.href = "www.teste.com/login";
}
What I tried would work?
$atacadoLogado = $this->helper('customer')->isLoggedIn();
$urlDoCadastro = "https://www.meusite.com/cadastro";
$pegarDominio = $_SERVER['HTTP_HOST'];
$urlAtualizada = (isset($_SERVER['HTTPS']) ? "https" : "http") . "://" . $pegarDominio . $_SERVER['REQUEST_URI'];
if(!$atacadoLogado && $urlAtualizada != $urlCadastro){
header("Location: https://www.meusite.com/login");
}
Knows the super global variable
$_SERVER
?– Woss
No, Anderson, I’m gonna do some research here, thanks for talking.
– Lucas de Carvalho