给网站添加外链go跳转效果既美观又可避免权重流失,确实是一个不错的功能。闲鱼用的主题自带go跳转,但是别的主题不一定有,所以有些朋友就想移植这个功能,其实也还蛮简单的,这里简单分享下这个部署方法。
代码方法
代码部署
①、新建一个go.php文件,放置到wordpress的根目录下,在go.php里面输入以下代码
这是知更鸟的go.php代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php // http://www.wayu.cn/ $t_url = preg_replace(‘/^url=(.*)$/i’,’$1′,$_SERVER[“QUERY_STRING”]); if(!emptyempty($t_url)) { preg_match(‘/(http|https):\/\//’,$t_url,$matches); if($matches){ $url=$t_url; $title=’页面加载中,请稍候…’; } else { preg_match(‘/\./i’,$t_url,$matche); if($match