Typecho评论链接重定向、加密
Typecho评论链接重定向、加密
第一步:打开var/Widget/Abstract/Comments.php文件,将
if ($this->url && $autoLink) {
echo '<a href="' , $this->url , '"' , ($noFollow ? ' rel="external nofollow"' : NULL) , '>' , $this->author , '</a>';
} else {
echo $this->author;
}
替换为:
if ($this->url && $autoLink) {
if(strpos($this->url, $this->options->siteUrl)!==false) {
echo '<a href="', $this->url, '">', $this->author, '</a>';
} else {
echo '<a href="', $this->options->siteUrl, 'redirect.html?url=', base64_encode($this->url), '" ',="" '="" rel="nofollow">', $this->author, '</a>';
}
} else {
echo $this->author;
}
第二步:将redirect.zip解压,把其中的base64.js和redirect.html上传到博客根目录。
点击下载:http://aikvn.com/usr/uploads/2012/04/172007328.zip
redirect.zip
实现方法:其实非常简单,利用PHP自带的Base64加密函数和通用JS揭秘函数,将URL地址加密输出,再通过redirect.html解密并跳转。由于使用了Javascript跳转,而搜索引擎是不识别Javascript的,因此对于搜索引擎来说,这个页面没有任何意义。从根本上杜绝了垃圾链接对博客的影响。
转自:AiKvn
最后更新于 2012-08-31 19:17:45 并被添加「typecho 转向」标签,已有 2022 位童鞋阅读过。
本站使用「署名 4.0 国际」创作共享协议,可自由转载、引用,但需署名作者且注明文章出处