首先让我说...我不是程序员。我什至不能拼写“ASP”。但是我需要有关以下 ASP 编码问题的帮助。Microsoft 技术支持为我编写了代码(如下),我现在正在我的网站上使用。然而,我们遇到了一个问题,代码似乎返回的是 302 状态而不是 301 状态。这可以在这里确认::http: //www.howto301redirect.com/301-redirect-checker/
这是代码...
<%
Dim serverName
serverName = Request.ServerVariables("SERVER_NAME")
Dim canRedirect
canRedirect = "False"
Dim hostNameArray(14) 'Array of host name
hostNameArray(0) = "bananapages.net"
hostNameArray(1) = "www.bananapages.net"
hostNameArray(2) = "6379100.com"
hostNameArray(3) = "www.6379100.com"
hostNameArray(4) = "caribbeanexhibits.com"
hostNameArray(5) = "www.caribbeanexhibits.com"
hostNameArray(6) = "caribbeanspecialevents.com"
hostNameArray(7) = "www.caribbeanspecialevents.com"
hostNameArray(8) = "caribeexpo.com"
hostNameArray(9) = "www.caribeexpo.com"
hostNameArray(10) = "daleallenenterprises.com"
hostNameArray(11) = "www.daleallenenterprises.com"
hostNameArray(12) = "daleallen.com"
hostNameArray(13) = "rrcpapsc.com"
hostNameArray(14) = "www.rrcpapsc.com"
For Each item In hostNameArray
If serverName = item Then
serverName = "www.daleallen.com"
canRedirect = "True"
Exit For
End If
Next
If canRedirect = "True" Then
Response.Status="301 Moved Permanently"
If Request.QueryString <> "" Then
Response.Redirect "http://" & serverName & Request.ServerVariables ("HTTP_X_REWRITE_URL") & "?" & Request.QueryString
Else
Response.Redirect "http://" & serverName & Request.ServerVariables("HTTP_X_REWRITE_URL")
End If
End If
%>
微软做错了什么导致 302 状态恢复?我们正在使用 ASP 脚本
戴尔·艾伦