【教程】如何做站内外链跳转优化
分类:教程分享 评论:4条 阅读:14644次

【教程】如何做站内外链跳转优化

分类:教程分享 评论:4条 阅读:14644次

外链想必大家都不陌生吧

那如何做站内外链跳转优化哪?

自己动手丰衣足食,首先创建一个go.php(名字可以自定义)文件,在go.php里面输入以下代码(记得修改代码中的域名blog.xuelg.com改为你自己的域名),然后上传到网站根目录下。

<?php
$t_url=$_GET['url'];
if(!empty($t_url)) {
    preg_match('/(http|https):\/\//',$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='https://blog.xuelg.com/';
            $title='参数错误,正在返回首页...';
        }
    }
} else {
    $title='参数缺失,正在返回首页...';
    $url='http://blog.xuelg.com/';
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="refresh" content="1;url='<?php echo $url;?>';">
<title><?php echo $title;?></title>
</head>

</html>

在添加外链的时候,只要给外链加上统一的跳转前缀:http://你的域名/go.php?url=要跳转到的地址,即可实现外链跳转效果。

本篇文章评论已被关闭。
  1. SEO

    SEO

  2. 所以为什么要外链跳转。。。

  3. h

    icon_evil.gif

    1. s
      @h

      大是大非