下面的脚本放在网站入口页面:
<script language='javascript' type='text/javascript'>
window.location.href='wp';
if(window.top.location !==window.location ){ top.location.href=self.location.href;}
</script>
原理就是通过href的值来判断,如果不是本域的地址,强行跳回原地址。
同样加CSP内容安全策略也可以达到同样的目的。