Redirect based on referrer URL

后端 未结 3 1222
庸人自扰
庸人自扰 2020-12-10 14:04

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

3条回答
  •  情深已故
    2020-12-10 14:49

    I found document.referrer doesn't work for me, but location.href works:

    if (location.href != "http://yoursite/index.html") {
        location.replace("http://yoursite/index.html");
    }
    

提交回复
热议问题