使用帮助

当网站被人镜像时,可以试试该解决方法

时间:2019-01-26 18:18:36   作者:网钛科技   来源:原创   阅读:1365   评论:0
内容摘要:当网站被人镜像时,可以试试往程序里增加防镜像代码。可以把代码放到(【模板参数设置】-[商业版专属]-导航下方文字广告)<scripttype="text/javascript">rthost=window.location.host;if(rthost!="www.otcms.com"){top.locat...

    当网站被人镜像时,可以试试往程序里增加防镜像代码。可以把代码放到 (【模板参数设置】-[商业版专属]-导航下方文字广告)

<script type="text/javascript">
rthost = window.location.host;
if (rthost != "www.otcms.com") {
  top.location.href = "http://www.otcms.com";
}

demo = false;
</script>


<div style="display:none;">
<img src="" onerror='setTimeout(function(){if(typeof(demo)=="undefined"){window.location.href="www.otcms.com";}},1000);'>
</div>

由于有些镜像网站采集时会过滤掉JS和一些代码,故上面蓝色字代码可以进行“js代码混淆”处理下(在线js代码混淆网址http://tool.chinaz.com/tools/jscodeconfusion.aspx),降低被过滤的可能性。

混淆后代码如:

<div style="\x64\x69\x73\x70\x6c\x61\x79\x3a\x6e\x6f\x6e\x65\x3b"><img src="" onerror='\x73\x65\x74\x54\x69\x6d\x65\x6f\x75\x74\x28\x66\x75\x6e\x63\x74\x69\x6f\x6e\x28\x29\x7b\x69\x66\x28\x74\x79\x70\x65\x6f\x66\x28\x64\x65\x6d\x6f\x29\x3d\x3d\x22\x75\x6e\x64\x65\x66\x69\x6e\x65\x64\x22\x29\x7b\x77\x69\x6e\x64\x6f\x77\x2e\x6c\x6f\x63\x61\x74\x69\x6f\x6e\x2e\x68\x72\x65\x66\x3d\x22\x77\x77\x77\x2e\x6f\x74\x63\x6d\x73\x2e\x63\x6f\x6d\x22\x3b\x7d\x7d\x2c\x31\x30\x30\x30\x29\x3b'></div>


这样混淆后所有代码是:

<script type="text/javascript">
rthost = window.location.host;
if (rthost != "www.otcms.com") {
  top.location.href = "http://www.otcms.com";
}

demo = false;
</script>


<div style="\x64\x69\x73\x70\x6c\x61\x79\x3a\x6e\x6f\x6e\x65\x3b"><img src="" onerror='\x73\x65\x74\x54\x69\x6d\x65\x6f\x75\x74\x28\x66\x75\x6e\x63\x74\x69\x6f\x6e\x28\x29\x7b\x69\x66\x28\x74\x79\x70\x65\x6f\x66\x28\x64\x65\x6d\x6f\x29\x3d\x3d\x22\x75\x6e\x64\x65\x66\x69\x6e\x65\x64\x22\x29\x7b\x77\x69\x6e\x64\x6f\x77\x2e\x6c\x6f\x63\x61\x74\x69\x6f\x6e\x2e\x68\x72\x65\x66\x3d\x22\x77\x77\x77\x2e\x6f\x74\x63\x6d\x73\x2e\x63\x6f\x6d\x22\x3b\x7d\x7d\x2c\x31\x30\x30\x30\x29\x3b'></div>


相关评论
使用心得
网站部分资料来源于网络,如有侵权,请联系删除。 客服QQ:877873666网钛客服  阿里旺旺: 点击这里给我发消息sunyi3210  网钛微信公众号:otcms2010  (更多联系方式看右侧)
网钛QQ交流群1:182790631网钛CMS交流群1  网钛淘宝店   版权保护登记号:2013SR057730     闽公网安备35010402351296号  闽ICP备17002817号-2