301(永久移動(dòng))請(qǐng)求的網(wǎng)頁(yè)已被永久移動(dòng)到新位置。服務(wù)器返回此響應(yīng)(作為對(duì)GET或HEAD請(qǐng)求的響應(yīng))時(shí),會(huì)自動(dòng)將請(qǐng)求者轉(zhuǎn)到新位置。使用此代碼可通知搜索引擎蜘蛛,某個(gè)網(wǎng)頁(yè)或網(wǎng)站已被永久移動(dòng)到新位置。
301(永久移動(dòng))請(qǐng)求的網(wǎng)頁(yè)已被永久移動(dòng)到新位置。服務(wù)器返回此響應(yīng)(作為對(duì)GET或HEAD請(qǐng)求的響應(yīng))時(shí),會(huì)自動(dòng)將請(qǐng)求者轉(zhuǎn)到新位置。使用此代碼可通知搜索引擎蜘蛛,某個(gè)網(wǎng)頁(yè)或網(wǎng)站已被永久移動(dòng)到新位置。
Internet信息服務(wù)管理器 -> 虛擬目錄 -> 重定向到URL,輸入需要轉(zhuǎn)向的目標(biāo)URL,并選擇“資源的重定向”。
<%@ Language=VBScript %> <% Response.Status="301 Moved Permanently" Response.AddHeader "Location", "http://www.shenghezhuangshi.com/" %>
<script runat="server"> private void Page_Load(object sender, System.EventArgs e) { Response.Status = "301 Moved Permanently"; Response.AddHeader("Location","http://www.shenghezhuangshi.com/"); } </script>
header("HTTP/1.1 301 Moved Permanently"); header("Location: http://www.shenghezhuangshi.com/"); exit();
$q = new CGI; print $q->redirect("http://www.shenghezhuangshi.com/");
<% response.setStatus(301); response.setHeader( "Location", "http://www.shenghezhuangshi.com/" ); response.setHeader( "Connection", "close" ); %>
新建.htaccess文件,輸入下列內(nèi)容(需要開啟mod_rewrite):
1)將不帶WWW的域名轉(zhuǎn)向到帶WWW的域名下
Options +FollowSymLinks RewriteEngine on RewriteCond %{HTTP_HOST} ^lesishu.cn [NC] RewriteRule ^(.*)$ http://www.shenghezhuangshi.com/$1 [L,R=301]
2)重定向到新域名
Options +FollowSymLinks RewriteEngine on RewriteRule ^(.*)$ http://www.shenghezhuangshi.com/$1 [L,R=301]
3)使用正則進(jìn)行301轉(zhuǎn)向,實(shí)現(xiàn)偽靜態(tài)
Options +FollowSymLinks RewriteEngine on RewriteRule ^news-(.+).html$ news.php?id=$1
如沒特殊注明,文章均為友孚原創(chuàng),轉(zhuǎn)載請(qǐng)注明來(lái)自:http://www.shenghezhuangshi.com/news/28.html
15038386808
地址:鄭州市索凌路8號(hào)22號(hào)樓11層