99久久.com|人妻无码色噜噜狠|第四色播五月婷婷|国产美女免费国产色色色综合色五月|婷婷影院五月伊人|凹凸久久99精品久久久久久琪琪|成人av中文字幕|超碰在线免费人人草|黄色毛片在线视频|国产极品美女无套

幫助中心

301(永久移動)請求的網頁已被永久移動到新位置。服務器返回此響應(作為對GET或HEAD請求的響應)時,會自動將請求者轉到新位置。使用此代碼可通知搜索引擎蜘蛛,某個網頁或網站已被永久移動到新位置。

網站如何做301跳轉

2021-01-25

301(永久移動)請求的網頁已被永久移動到新位置。服務器返回此響應(作為對GET或HEAD請求的響應)時,會自動將請求者轉到新位置。使用此代碼可通知搜索引擎蜘蛛,某個網頁或網站已被永久移動到新位置。

1、IIS下301設置 

Internet信息服務管理器 -> 虛擬目錄 -> 重定向到URL,輸入需要轉向的目標URL,并選擇“資源的重定向”。 

2、ASP下的301轉向代碼

<%@ Language=VBScript %> <%     Response.Status="301 Moved Permanently"     Response.AddHeader "Location", "http://www.lymdtni.cn/" %>

 

3、ASP.Net下的301轉向代碼

<script runat="server">     private void Page_Load(object sender, System.EventArgs e)     {     Response.Status = "301 Moved Permanently";     Response.AddHeader("Location","http://www.lymdtni.cn/");     } </script>

4、PHP下的301轉向代碼

header("HTTP/1.1 301 Moved Permanently"); header("Location: http://www.lymdtni.cn/"); exit();

5、CGI Perl下的301轉向代碼

$q = new CGI; print $q->redirect("http://www.lymdtni.cn/");

6、JSP下的301轉向代碼

<%     response.setStatus(301);     response.setHeader( "Location", "http://www.lymdtni.cn/" );     response.setHeader( "Connection", "close" ); %>

7、Apache下301轉向代碼 

新建.htaccess文件,輸入下列內容(需要開啟mod_rewrite): 

1)將不帶WWW的域名轉向到帶WWW的域名下

Options +FollowSymLinks RewriteEngine on RewriteCond %{HTTP_HOST} ^lesishu.cn [NC] RewriteRule ^(.*)$ http://www.lymdtni.cn/$1 [L,R=301]

2)重定向到新域名 

Options +FollowSymLinks RewriteEngine on RewriteRule ^(.*)$ http://www.lymdtni.cn/$1 [L,R=301]

3)使用正則進行301轉向,實現(xiàn)偽靜態(tài)

Options +FollowSymLinks RewriteEngine on RewriteRule ^news-(.+).html$ news.php?id=$1


如沒特殊注明,文章均為友孚原創(chuàng),轉載請注明來自:http://www.lymdtni.cn/news/28.html