In my site I have a password protected page containing some links to other sites also operated by myself that cannot be password protected. I would like to place a HTML code
if (document.referrer !== "http://www.stackoverflow.com") { window.location.href = "http://www.google.com"; }
Or you can use regular expressions to check the referrer.
Anyway, this solution is really, really unsafe. You can just turn off JavaScript in your browser and won't be redirected...