首页 >娱乐
转页面样ress加一个go跳式二
发布日期:2025-11-04 02:50:11
浏览次数:915

之前使用的转页主题自带这个go页面 ,这个主题没有 ,面样但是转页也没在意过 ,最近突然发现没有的面样,就想着给加一个。转页

听说这个是面样对seo有点好处,但是转页这种有点玄学的问题,也不好说。面样漂亮还是转页很漂亮的,而且方法也简单,面样所以各位可以尝试加一个。转页

首先呢需要在网站根目录下面新建一个文件夹命名为go,面样然后在文件夹下新建一个index.php的转页文件,或者直接新建一个名为go.php的面样文件,随你怎么喜欢怎么来 。转页

然后把以下代码复制进去即算是完成第一步 。

跳转页面 * @copyright (c) Emlog All Rights Reserved */ //自定义跳转地址 $cars = array( array("rwdh",https://renwai.cn/), array("jsys",https://v.ir12.cn/), ); if(strlen($_SERVER[REQUEST_URI])>384||strpos($_SERVER[REQUEST_URI], "eval(")||strpos($_SERVER[REQUEST_URI], "base64")){ @header("HTTP/1.1 414 Request-URI Too Long"); @header("Status: 414 Request-URI Too Long"); @header("Connection: Close"); @exit; } //通过QUERY_STRING取得完整的传入数据 ,然后取得url=之后的所有值 ,兼容性更好 $t_url = htmlspecialchars(preg_replace(/^url=(.*)$/i,$1,$_SERVER["QUERY_STRING"])); //此处可以自定义一些特别的外链 ,不需要可以删除以下5行 foreach($cars as $k=>$val){ if($t_url==$val[0]){ $t_url = $val[1]; $t_vip = 1; } } //数据处理 if(!empty($t_url)){ //判断取值是否加密 if($t_url == base64_encode(base64_decode($t_url))){ $t_url = base64_decode($t_url); } //对取值进行网址校验和判断 preg_match(/^(http|https|thunder|qqdl|ed2k|Flashget|qbrowser):\/\//i,$t_url,$matches); if($matches){ $url=$t_url; $title=页面加载中,请稍候...; }else{ preg_match(/\./i,$t_url,$matche); if($matche){ $url=http://.$t_url; $title=页面加载中,请稍候...; }else{ $url = http://.$_SERVER[HTTP_HOST]; $title=参数错误,正在返回首页...; } } }else{ $title = 参数缺失,正在返回首页...; $url = http://.$_SERVER[HTTP_HOST]; } ?><?php echo $title;?>
3

一万年太久,只争朝夕

立即前往
跳转页面 * @copyright (c) Emlog All Rights Reserved */ //自定义跳转地址 $cars = array( array("rwdh",https://renwai.cn/), array("jsys",https://v.ir12.cn/), ); if(strlen($_SERVER[REQUEST_URI]) > 384 || strpos($_SERVER[REQUEST_URI], "eval(") || strpos($_SERVER[REQUEST_URI], "base64")) { @header("HTTP/1.1 414 Request-URI Too Long"); @header("Status: 414 Request-URI Too Long"); @header("Connection: Close"); @exit; } //通过QUERY_STRING取得完整的传入数据 ,然后取得url=之后的所有值 ,兼容性更好 $t_url = htmlspecialchars(preg_replace(/^url=(.*)$/i,$1,$_SERVER["QUERY_STRING"])); //此处可以自定义一些特别的外链 ,不需要可以删除以下5行 foreach($cars as $k=>$val){ if($t_url==$val[0] ) { $t_url = $val[1]; $t_vip = 1; } } //数据处理 if(!empty($t_url)) { //判断取值是否加密 if ($t_url == base64_encode(base64_decode($t_url))) { $t_url = base64_decode($t_url); } //对取值进行网址校验和判断 preg_match(/^(http|https|thunder|qqdl|ed2k|Flashget|qbrowser):\/\//i,$t_url,$matches); if($matches){ $url=$t_url; $title=页面加载中,请稍候...; } else { preg_match(/\./i,$t_url,$matche); if($matche){ $url=http://.$t_url; $title=页面加载中,请稍候...; } else { $url = http://.$_SERVER[HTTP_HOST]; $title=参数错误  ,正在返回首页...; } } } else { $title = 参数缺失 ,正在返回首页...; $url = http://.$_SERVER[HTTP_HOST]; } ?><?php echo $title;?>
3

一万年太久 ,只争朝夕

立即前往
384 || strpos($_SERVER[REQUEST_URI], "eval(") || strpos($_SERVER[REQUEST_URI], "base64")) { @header("HTTP/1.1 414 Request-URI Too Long"); @header("Status: 414 Request-URI Too Long"); @header("Connection: Close"); @exit; } //通过QUERY_STRING取得完整的传入数据 ,然后取得url=之后的所有值 ,兼容性更好 $t_url = htmlspecialchars(preg_replace(/^url=(.*)$/i,$1,$_SERVER["QUERY_STRING"])); //此处可以自定义一些特别的外链,不需要可以删除以下5行 foreach($cars as $k=>$val){ if($t_url==$val[0] ) { $t_url = $val[1]; $t_vip = 1; } } //数据处理 if(!empty($t_url)) { //判断取值是否加密 if ($t_url == base64_encode(base64_decode($t_url))) { $t_url = base64_decode($t_url); } //对取值进行网址校验和判断 preg_match(/^(http|https|thunder|qqdl|ed2k|Flashget|qbrowser):\/\//i,$t_url,$matches); if($matches){ $url=$t_url; $title=页面加载中,请稍候...; } else { preg_match(/\./i,$t_url,$matche); if($matche){ $url=http://.$t_url; $title=页面加载中,请稍候...; } else { $url = http://.$_SERVER[HTTP_HOST]; $title=参数错误 ,正在返回首页...; } } } else { $title = 参数缺失,正在返回首页...; $url = http://.$_SERVER[HTTP_HOST]; } ?><?php echo $title;?>
3

一万年太久,只争朝夕

立即前往

需要注意的一点是 ,如果你们是新建的go.php而不是go文件夹的话需要修改下面的代码,把go改为go.php即可,我会给那一段标红 ,方便各位查看修改 。

接下来这一段代码会让你文章中和评论区的所有外链自动跳转go页面 ,只需要将以下代码复制粘贴到你当前使用主题的functions.php文件里面,随便粘贴到哪一行都行 。

//评论者链接添加go跳转 functionadd_redirect_comment_link($text = ){ $text=str_replace(href=", href=".get_option(home)./go/?url=, $text); return $text; } add_filter(get_comment_author_link, add_redirect_comment_link, 5); add_filter(comment_text, add_redirect_comment_link, 99); //文章内外链添加go跳转 functionthe_content_nofollow($content){ preg_match_all(//,$content,$matches); if($matches){ foreach($matches[2] as $val){ if(strpos($val,://)!==false&&strpos($val,home_url())===false&& !preg_match(/\.(jpg|jepg|png|ico|bmp|gif|tiff)/i,$val)){ $content=str_replace("href=\"$val\"", "href=\"".home_url()."/go/?url=$val\" ",$content); } } } return $content; } add_filter(the_content,the_content_nofollow,999); //评论者链接添加go跳转 function add_redirect_comment_link($text = ){ $text=str_replace(href=", href=".get_option(home)./go/?url=, $text); return $text; } add_filter(get_comment_author_link, add_redirect_comment_link, 5); add_filter(comment_text, add_redirect_comment_link, 99); //文章内外链添加go跳转 function the_content_nofollow($content){ preg_match_all(//,$content,$matches); if($matches){ foreach($matches[2] as $val){ if(strpos($val,://)!==false && strpos($val,home_url())===false && !preg_match(/\.(jpg|jepg|png|ico|bmp|gif|tiff)/i,$val)){ $content=str_replace("href=\"$val\"", "href=\"".home_url()."/go/?url=$val\" ",$content); } } } return $content; } add_filter(the_content,the_content_nofollow,999); //评论者链接添加go跳转 function add_redirect_comment_link($text = ){ $text=str_replace(href=", href=".get_option(home)./go/?url=, $text); return $text; } add_filter(get_comment_author_link, add_redirect_comment_link, 5); add_filter(comment_text, add_redirect_comment_link, 99); //文章内外链添加go跳转 function the_content_nofollow($content){ preg_match_all(//,$content,$matches); if($matches){ foreach($matches[2] as $val){ if(strpos($val,://)!==false && strpos($val,home_url())===false && !preg_match(/\.(jpg|jepg|png|ico|bmp|gif|tiff)/i,$val)){ $content=str_replace("href=\"$val\"", "href=\"".home_url()."/go/?url=$val\" ",$content); } } } return $content; } add_filter(the_content,the_content_nofollow,999);

最后我们使用https://www.xiunobbs.vip/go/?url=或者https://www.xiunobbs.vip/go.php?url=就可以使用跳转页了。并且站点内的外链都会用跳转页打开了。

内容看完了 © 版权声明 1:本网站名称:蜡笔傻新

2:本站永久网址 :https://labishaxin.com/

3:本站部分内容收集于互联网 ,如果有侵权内容 、请联系我们删除 ,不妥之处 ,敬请谅解

4:本站一切资源不代表本站立场,并不代表本站赞同其观点和对其真实性负责

5:本站一律禁止以任何方式发布或转载任何违法的相关信息 ,访客发现请向站长举报

6:本站资源大多存储在云盘,如发现链接失效 ,请联系我们我们会第一时间更新

上一篇:XIUNO 积分插件
下一篇:RawTherapee 5.9 RAW图像编辑处理
相关文章