聯 系 人:李總
聯系電話:13759574266
在線 QQ:89417157
郵箱:13759574266@qq.com
微信號:ynlongtou
地址:昆明市滇緬大道旁昆建路5號108智庫空間A座4樓
頂級域名“www.charti.com.cn”做權重可以傳遞的301永久跳轉,轉到一級域名“www.www.charti.com.cn”。一來讓網站權重更加集中,二來,保持一致性。
<%
currentdomain= request.ServerVariables("SERVER_NAME")
If currentdomain="wangyuwen.com" or currentdomain="http://www.charti.com.cn" then
Response.Status="301 Moved Permanently"
Response.AddHeader "Location","http://www.www.charti.com.cn"
End if
%>
ASP Request
Request對象用于從用戶那里取得信息。
request.ServerVariables
ServerVariables 集合用于取回服務器變量的值。
SERVER_NAME:返回服務器主機名、DNS別名,或者IP地址。
ASP Response
Response對象用于從服務器向用戶發送輸出的結果。
Response.Status:
Status 屬性規定由服務器返回的狀態行的值。
web.config文件中配置301跳轉帶代碼
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="WWW Redirect" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_HOST}" pattern="^www.charti.com.cn$" />
</conditions>
<action type="Redirect" url="http://www.www.charti.com.cn/{R:0}" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
掃描關注官方微信