seo中網(wǎng)站的跳轉(zhuǎn)優(yōu)化(優(yōu)化技術(shù)), 站內(nèi)跳轉(zhuǎn)go.php優(yōu)化版更新
注重seo的站長都了解,過多的外鏈會影響網(wǎng)站權(quán)重,而且影響極大。那么有沒有一種不輸出權(quán)重的站內(nèi)跳轉(zhuǎn)方式呢?很多站長通過go.php的方式跳轉(zhuǎn),這個(gè)方法是不錯(cuò)的,但是必須要用對、用精,而且URL美觀性也是另一個(gè)問題,下面給各位站長從頭到尾講解一下。
一、SEO禁止抓取優(yōu)化
首先來分析,由于百度也會抓取php頁面,通過go.php直接跳轉(zhuǎn),并不能保證效果。所以需要在跳轉(zhuǎn)頁面加上一句:
1 | <meta name= "robots" content= "noindex, nofollow" /> |
同時(shí),在robots.txt也加上一句:
1 | Disallow: /go.php |
這樣,百度就不會抓取這個(gè)專門用來跳轉(zhuǎn)的頁面了。
二、跳轉(zhuǎn)時(shí)間優(yōu)化跳轉(zhuǎn)的時(shí)間既不能太長也不能太短,一秒鐘剛剛好。同時(shí)也要設(shè)置10秒鐘后自動(dòng)關(guān)閉跳轉(zhuǎn)頁面,比如下載文件時(shí),文件下載完成時(shí),這個(gè)頁面并不會自動(dòng)關(guān)閉,這里通過JS實(shí)現(xiàn),代碼如下:
1 2 3 4 5 6 7 8 | <script> function jump() { location.href= "" ; } //from www.imotao.com setTimeout(jump, 10000); setTimeout( function (){window.opener=null;window.close();}, 10000);cript> |
三、URL美觀性優(yōu)化
imotao.com/go.php?url=baidu.com,這么長的參數(shù),簡直逼死強(qiáng)迫癥。那么,我們可以使用nginx的偽靜態(tài)來美化一下,這樣就挺不錯(cuò):imotao.com/go/baidu.com,通過下方的nginx偽靜態(tài)規(guī)則來實(shí)現(xiàn)(注意如果go.php不在根目錄,需將目錄換成自己):
1 | rewrite ^/go/(.*)$ /go.php?url= $1 last; |
如此,甚好!但是聰明的我們也要想到,在robots.txt文件中再加一句:
1 | Disallow: /go/ |
四、防止別人盜用我們的go.php...自己發(fā)揮吧
五、最終完整的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 | <?php $url = preg_replace( '/^url=(.*)$/i' , '$1' , $_SERVER [ "QUERY_STRING" ]); if (! empty ( $url )) { preg_match( '/(http|https):\/\//' , $url , $matches ); //from http://www.336xyz.com/ if ( $matches ){ $url = $url ; $title = '頁面加載中,請稍候...' ; } else { preg_match( '/\./i' , $url , $matche ); if ( $matche ){ $url = 'http://' . $url ; $title = '頁面加載中,請稍候...' ; } else { $url = 'http://www.336xyz.com/' ; $title = '參數(shù)錯(cuò)誤,正在返回首頁...' ; } } } else { $title = '參數(shù)缺失,正在返回首頁...' ; $url = 'http://www.336xyz.com/' ; } ?><meta http-equiv= "Content-Type" content= "text/html; charset=UTF-8" ><meta name= "generator" content= "imotao-com" /><noscript><meta http–equiv= "refresh" content= "1;url='';" >cript><script> function jump() { location.href= "" ; } //from www.imotao.com setTimeout(jump, 1000); setTimeout( function (){window.opener=null;window.close();}, 10000);cript><meta name= "robots" content= "noindex, nofollow" /><meta name= "author" content= "imotao.com" />rames 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:50%;left:50%;margin-left:-90px;margin-top: 2px;color:#BBB;letter-spacing:1px;font-weight:700;font-size:36px;font-family:Arial}.spinner{position:absolute;top:50%;left:50%;display:block;margin-left:-160px;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)}} " _ue_custom_node_=" true"> 頁面加載中,請稍候... |
如此一來,我們擁有了還算完美的SEO不輸出權(quán)重的站內(nèi)跳轉(zhuǎn)方法。
本文鏈接:http://www.336xyz.com/seoyh/167.html
本文標(biāo)簽:
版權(quán)聲明:
本站所有原創(chuàng)作品,其版權(quán)屬于兩山建站( http://www.336xyz.com )所有。任何媒體、網(wǎng)站或個(gè)人轉(zhuǎn)載須注明此文章來源URL。被本站授權(quán)使用單位,不應(yīng)超越授權(quán)范圍。本站部分文章來源于網(wǎng)絡(luò),如侵犯到您的權(quán)利請聯(lián)系我們,我們將立即刪除。