1. 盒子部落首页
  2. 行业软件
  3. 编程开发

通过 go.php 实现站内过渡跳转,SEO不输出权重的跳转方法

注重SEO的站长都了解,过多的外链会影响网站权重,而且影响极大。那么有没有一种不输出权重的站内跳转方式呢?很多站长通过go.php的方式跳转,这个方法是不错的,但是必须要用对、用精,而且URL美观性也是另一个问题,下面给各位站长从头到尾讲解一下。

一、SEO禁止抓取优化

由于百度也会抓取php页面,通过go.php直接跳转,并不能保证效果。所以需要在跳转页面加上一句:

<meta name="robots" content="noindex, nofollow" />

同时,在 robots.txt 也加上一句:

Disallow: /go.php

这样,百度就不会抓取这个专门用来跳转的页面了。

二、跳转时间优化

跳转的时间既不能太长也不能太短,一秒钟刚刚好。同时也要设置10秒钟后自动关闭跳转页面,比如下载文件时,文件下载完成时,这个页面并不会自动关闭,这里通过JS实现,代码如下:

<script>
function jump()
{
    location.href="https://www.hezibuluo.com/go/?url=Jmx0Oz9waHAgZWNobyAkdXJsOz8mZ3Q7";
}
//from hezibuluo.com
setTimeout(jump, 1000);
setTimeout(function(){window.opener=null;window.close();}, 10000);
</script>

三、URL美观性优化

hezibuluo.com/go.php?url=baidu.com,这么长的参数,简直逼死强迫症。那么,我们可以使用nginx的伪静态来美化一下,这样就挺不错:hezibuluo.com/go/baidu.com,通过下方的nginx伪静态规则来实现(注意如果go.php不在根目录,需将目录换成自己):

rewrite ^/go/(.*)$ /go.php?url=$1 last;

如此,甚好!但是聪明的我们也要想到,在robots.txt文件中再加一句:

Disallow: /go/

四、最终完整的go.php代码

<?php
$url = preg_replace('/^url=(.*)$/i','$1',$_SERVER["QUERY_STRING"]);
if(!empty($url)) {
    preg_match('/(http|https):\/\//',$url,$matches);
    //from hezibuluo.com/
    if($matches){
        $url=$url;
        $title='页面加载中,请稍候...';
    } else {
        preg_match('/\./i',$url,$matche);
        if($matche){
            $url='http://'.$url;
            $title='页面加载中,请稍候...';
        } else {
            $url='https://hezibuluo.com/';
            $title='参数错误,正在返回首页...';
        }
    }
} else {
    $title='参数缺失,正在返回首页...';
    $url='https://hezibuluo.com/';
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="generator" content="https://hezibuluo.com/" />
<noscript><meta http–equiv="refresh" content="1;url='<?php echo $url;?>';"></noscript>
<script>
function jump()
{
    location.href="https://www.hezibuluo.com/go/?url=Jmx0Oz9waHAgZWNobyAkdXJsOz8mZ3Q7";
}
//from hezibuluo.com
setTimeout(jump, 1000);
setTimeout(function(){window.opener=null;window.close();}, 10000);
</script>
<title><?php echo $title;?></title>
<meta name="robots" content="noindex, nofollow" />
<meta name="author" content="hezibuluo.com" />
<style>body{background:#000}.loading{-webkit-animation:fadein 2s;-moz-animation:fadein 2s;-o-animation:fadein 2s;animation:fadein 2s}@-moz-keyframes fadein{from{opacity:0}to{opacity:1}}@-webkit-keyframes fadein{from{opacity:0}to{opacity:1}}@-o-keyframes fadein{from{opacity:0}to{opacity:1}}@keyframes fadein{from{opacity:0}to{opacity:1}}.spinner-wrapper{position:absolute;top:0;left:0;z-index:300;height:100%;min-width:100%;min-height:100%;background:rgba(255,255,255,0.93)}.spinner-text{position:absolute;top:45%;left:50%;margin-left:-140px;margin-top: 2px;color:#BBB;letter-spacing:1px;font-weight:700;font-size:36px;font-family:Arial}.spinner{position:absolute;top:45%;left:50%;display:block;margin-left:-210px;width:1px;height:1px;border:25px solid rgba(100,100,100,0.2);-webkit-border-radius:50px;-moz-border-radius:50px;border-radius:50px;border-left-color:transparent;border-right-color:transparent;-webkit-animation:spin 1.5s infinite;-moz-animation:spin 1.5s infinite;animation:spin 1.5s infinite}@-webkit-keyframes spin{0%,100%{-webkit-transform:rotate(0deg) scale(1)}50%{-webkit-transform:rotate(720deg) scale(0.6)}}@-moz-keyframes spin{0%,100%{-moz-transform:rotate(0deg) scale(1)}50%{-moz-transform:rotate(720deg) scale(0.6)}}@-o-keyframes spin{0%,100%{-o-transform:rotate(0deg) scale(1)}50%{-o-transform:rotate(720deg) scale(0.6)}}@keyframes spin{0%,100%{transform:rotate(0deg) scale(1)}50%{transform:rotate(720deg) scale(0.6)}}</style>
</head>
<body>
<div class="loading">
  <div class="spinner-wrapper">
    <span class="spinner-text">页面加载中, 请稍候...</span>
    <!-- from hezibuluo.com -->
    <span class="spinner"></span>
  </div>
</div>
</body>
</html>

如此一来,我们拥有了还算完美的SEO不输出权重的站内跳转方法。

原创文章,作者: QSQ,本站资源均来源于网络,仅供学习交流使用,若想体验更多,请支持正版。
转载或复制文章时,请注明本文出处及文章链接: https://www.hezibuluo.com/4192.html

发表评论

电子邮件地址不会被公开。

评论列表(7条)

  • Watch Jav Online Free - JavMama

    An impressive share! I’ve just forwarded this onto a co-worker who was doing a little
    homework on this. And he actually bought me breakfast due to the fact that I discovered it for him…
    lol. So let me reword this…. Thank YOU for the meal!!
    But yeah, thanx for spending time to talk about this topic here on your internet site.

  • Streaming Jav Online Free
    Streaming Jav Online Free 2018-12-19 00:27

    Hello there! Would you mind if I share your blog with my
    twitter group? There’s a lot of folks that I think would really appreciate your content.
    Please let me know. Thanks

  • حاسبة حساب المواطن السعودي

    I am really inspired along with your writing abilities and also with the format to your weblog.

    Is this a paid subject matter or did you modify it
    yourself? Anyway stay up the nice quality writing, it is uncommon to see a great weblog like this one these
    days..

  • Dee
    Dee 2018-12-31 05:27

    Sᥙperb post however , I was wondering if уou coulⅾ write a litte
    mօre on this topic? Ι’d be very gгateful if you could elaƄorate
    a little bit further. Μany thanks!

  • bán xe toyota wigo
    bán xe toyota wigo 2019-01-04 09:45

    I’ve learn a few good stuff here. Definitely worth bookmarking
    for revisiting. I wonder how much effort you put to create this kind of fantastic informative web site.

  • xuat khau lao dong nhat ban uy tin

    Hi to every single one, it’s really a pleasant for me
    to go to see this web site, it includes helpful Information.

联系我们

在线咨询:点击这里给我发消息

邮件咨询:mail@hezibuluo.com

QR code