<%
'========301跳转开始========
Dim An_Jump
An_Jump=True '是否开启301跳转 开启: True 关闭: False
If Lcase(Left(Request.ServerVariables("Server_name"),3))<>"www" and An_Jump Then
Response.Status="301 Moved Permanently"
Response.AddHeader "Location", GetUrl
Response.End
End If
'Response.Write GetUrl '测试url
Function GetUrl()
On Error Resume Next
Dim strTemp
If LCase(Request.ServerVariables("HTTPS")) = "off" Then
strTemp = "https://"
Else
strTemp = "https://"
End If
If Lcase(Left(Request.ServerVariables("Server_name"),3))<>"www" Then
strTemp = strTemp&"www."
End If
strTemp = strTemp & Request.ServerVariables("SERVER_NAME")
If Request.ServerVariables("SERVER_PORT") <> 80 Then
strTemp = strTemp & ":" & Request.ServerVariables("SERVER_PORT")
end if
GetUrl = strTemp
End Function
'========301跳转结束========
%>