I've been messing around and trying to create an HTML website with a login page. Problem is, you can bypass the login page by typing (domain)/page.html, so I tried using this javascript script.
<script>
var x = document.referrer;
if (x == "(domain)") {
console.log(x);
} else {
window.location.href = "/";
};
</script>
After adding that to my code, I ran into another problem. I go through the login page and hit submit. It redirects me to page.html like it should, but then it instantly redirects me back to the login page. Can someone help with this?