asp环境下实现301永久定向的方法
No Comments »
<%
if request.ServerVariables(“HTTP_HOST”)=”yaohaibin.com” or request.ServerVariables(“HTTP_HOST”)=www.yaohaibin.com.cn then
if Request.ServerVariables(“QUERY_STRING”)<>”" then p=”?”
Response.Status=”301 Moved Permanently”
Response.AddHeader “Location”,”http://www.yaohaibin.com”&Request.ServerVariables(“SCRIPT_NAME”)&p&Request.ServerVariables(“QUERY_STRING”)
Response.End
end if
%>