欢迎访问 舍力博客(www.syom.cn)
这几天百度一下舍力博客,博客被别人完全境像代理,基本上就是直接让他给复制过去了,我也是醉了,虽然舍力不知道他们是怎么做到的,但是可以做一些小小的调整,让他们没哟那么容易,下面说说一些具体方法:
1、如果镜像没有删除你的js的话,可以试用js跳转来实现,直接在网页的头部<head></head>之间加入下面代码:
<script type="text/javascript">if(window["\x6c\x6f\x63\x61\x74\x69\x6f\x6e"]["\x68\x6f\x73\x74"] != 'www.shuyong.net' && window["\x6c\x6f\x63\x61\x74\x69\x6f\x6e"]["\x68\x6f\x73\x74"] != 'blog.shuyong.net' &&window["\x6c\x6f\x63\x61\x74\x69\x6f\x6e"]["\x68\x6f\x73\x74"] != 'sy.shuyong.net'){window["\x6c\x6f\x63\x61\x74\x69\x6f\x6e"]["\x68\x72\x65\x66"] = 'http://'+'123.shuyong.net/';}</script>
把代码中的网址替换成自己的就可以了,&&后面的是可以删除掉的,表示多个而已。
示例镜像站点:www.shuyong.net.3s3s.org
2、如果镜像站点删除了js,那么上面的代码就完全失效了,不过可以写个简单的div+css提示说明是镜像站点,具体操作方法如下:
a、在头部<head></head>之间下写入代码
<style>#fjx{width:100%;height:100%;margin:auto;background:#fff;z-index:1000;left:0;right:0;top:0;bottom:0;position:fixed;}.fjx{text-align:center;font-size:18px;margin-top:200px;}.fjx p{border-bottom:1px solid rgba(244,116,2,1);}</style> <script type="text/javascript"> window["\x64\x6f\x63\x75\x6d\x65\x6e\x74"]["\x77\x72\x69\x74\x65\x6c\x6e"]("\x3c\x73\x74\x79\x6c\x65\x3e\x23\x66\x6a\x78\x2c\x2e\x66\x6a\x78\x7b\x64\x69\x73\x70\x6c\x61\x79\x3a\x6e\x6f\x6e\x65\x21\x69\x6d\x70\x6f\x72\x74\x61\x6e\x74\x3b\x7d\x3c\x2f\x73\x74\x79\x6c\x65\x3e");</script>
b、在底部文件</body>之前写入如下代码
<div id="fjx"><div class="fjx"><p>舍力博客提示:你现在浏览的网站是镜像网站</p>请访问原网站:www.shuyong.net</div></div>
代码中的文字之间去修改。
示例镜像站点:http://www.shuyong.net.lapaleo.com/
温馨提示:可以把2个代码写到一起,这样的话,如果没有屏蔽你 js就直接跳转,屏蔽的就会显示一段文字提示。。动手试试吧。有问题请在本页面留言。。
来自张戈博客的代码,亲测部分镜像站有效,代码如下:
<img style="display:none" src=" " onerror='var currentDomain="www."+"shuyong." + "net";var str1=currentDomain; str2="docu"+"ment.loca"+"tion.host";str3=eval(str2);if(str1!=str3 ){do_action = "loca" + "tion." + "href = loca" + "tion.href" + ".rep" + "lace(docu" +"ment"+".loca"+"tion.ho"+"st," + "currentDomain" + ")";eval(do_action) }' />
<img style="display:none" src=" " onerror='var currentDomain="www."+"shuyong" +".net"; var str1=currentDomain;str2="docu"+"ment.loca"+"tion.host"; str3=eval(str2);if(str1!=str3 && str3!="cache.baiducontent.com" && str3!="webcache.googleusercontent.com" && str3!="c.360webcache.com" && str3!="snapshot.sogoucdn.com" && str3!="shuyong.net" ){do_action ="loca" + "tion." + "href = loca" + "tion.href" + ".rep" + "lace(docu" +"ment"+".loca"+"tion.ho"+"st," + "currentDomain" + ")";eval(do_action) }' />
此代码请放入<bdoy></body>之间,其中的网址改为你自己的即可,格式:"xxx."+"xxx."+"xxx",没有www的请去掉最开始的一部分
留言/评论:◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。