這兩天在寫bellydance.tw網站時,突然發現一件事,有些網站會連結不到我的網站,會出現。「您是不是要查:www.bellydance.tw」
想了一下,才發現原來是我忘了做301網址的工作了。因為這對於網頁SEO也有一定的影響,所以就一起做一個介紹。
一、什麼是301重新導向(301 Redirect)?
301重新導向又稱為永久性重新導向,如果我們希望在搜尋引擎搜尋的結果中能夠顯示的我們所指定的網頁網址,那麼就要做301重新導向的工作。這是確保使用者和搜尋引擎都能導向至正確網頁最好的方式。
例如:我的一個夏威夷舞蹈網站hula.dance.tw,使用者可以透過多種方式進入我的首頁,
http://www.dance.tw/hula
http://dance.tw/hula
http://hula.dance.tw
但是,為了SEO我希望能選擇其中的一個網址做為我的標準網址,所以我使用301重新導向,將其他網址的流量傳送至您的偏好網址。
個網址去。(其它常見的狀態碼還包括,200表示一切正常,404網頁找不到,302暫時轉向,等等。)
二、如何修改呢301重新導向呢?
我們可以在根目錄下看到. htaccess這個檔案,如果沒有的話自己新建立一個,權限請設為644。再將以下的程式碼複製下來,貼上. htaccess檔案中,再修改成自己的網址名稱即可。
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.dance.tw/hula$ [NC]
RewriteRule ^(.*)$ http://hula.dance.tw/$1 [R=301,L]
說明: RewriteEngine on,綠色字體的部分會將所有指向 www.dance.tw/hula都用 301 redirect的方法轉向到紅色字體的 http://hula.dance.tw去

very nice post must bookmark this post
[Translate]
Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic. If possible, as you gain expertise, would you mind updating your blog with more information? It is extremely helpful for me.
[Translate]
You completed a number of fine points there. I did a search on the subject matter and found nearly all people will go along with with your blog.
[Translate]
Good post!I accidently found your blog on the search engines, Let me be ever coming back here yet again.Love This is a test!!
[Translate]
Brilliant Collection.
[Translate]
This is a really good content. I am sure a lot of people will profit from it. Ty!
[Translate]