当前位置:K88软件开发文章中心编程语言AspAsp01 → 文章内容

可用于伪静态的301重定向ASP类

减小字体 增大字体 作者:backmouse     来源:asp编程网  发布时间:2018-12-30 8:35:15

s = split(aStrs(iUrls),",") For iStrs=0 To Ubound(aStrss) alStr(iUrls) = replace(alStr(iUrls),"
#"&
iStrs,Request.QueryString(aStrss(iStrs))) Next Response.Status="301 Moved Permanently" Response.AddHeader "Location","http://"&
ToUrl &
alStr(iUrls) Response.End End if Next '进行不带参数的伪静态页面301重定向 aUrl = split(jUrl,"|") For iUrl=0 To Ubound(aUrl) If Instr(ScriptName,aUrl(iUrl)) >
0 then Response.Status="301 Moved Permanently" Response.AddHeader "Location","http://"&
ToUrl &
replace(Request.ServerVariables("SCRIPT_NAME"),".asp",ToHtml) Response.End End if Next Else '当获取的路径为后台时,直接301重定向动态页面。 Response.Status="301 Moved Permanently" Response.AddHeader "Location","http://"&
ToUrl &
Request.ServerVariables("SCRIPT_NAME") End if End If End SubEnd Class%>
<
%调用代码示例:Dim pSet p = New Redirection_BackMousep.jUrls = "/news_index.asp|/book_index.asp"p.jStrs = "NewsType,ListPage|id"p.lStrs = "/news_index_
#0_
#1.html|/book_index_
#0.html"p.jUrl = "/login.asp|/reg.asp|/loginout.asp|/protocol.asp|/index.asp"p.PastUrl = "xxx.com"p.ToUrl = "www.xxx.com"p.NotPath = "/admin/|/demo/"p.ToHtml = ".html"p.Redirection()Set p = Nothing%>
(鼠标移到代码上去,在代码的顶部会出现四个图标,第一个是查看源代码,第二个是复制代码,第三个是打印代码,第四个是帮助)

 


上一页  [1] [2] 


可用于伪静态的301重定向ASP类