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