【发布时间】:2014-01-15 09:00:55
【问题描述】:
我一直在关注丹麦 CMS 中有关 301 重定向的指南,但他们不会就此主题提供任何形式的支持。我不擅长 .asp 和我尝试过的事情,我可以想象问题会是什么。
问题是案例不起作用,所有内容都被重定向到首页,而不是我所说的特定链接。
Dim BadURLAll, BadURLPath, BadURLParam, RedirectTo
BadURLAll = LCase(Request.ServerVariables("HTTP_URL"))
BadURLAll = Right(BadURLAll, (Len(BadURLAll) - (Instr(BadURLAll, chr(59)))))
if LEFT(BadURLAll,7) = "http://" then
BadURLAll = Mid(BadURLAll, 8)
end if
Pos = Instr(BadURLAll, "/")
if Pos > 0 then
BadURLAll = Mid(BadURLAll,Pos)
end if
BadURLPath = BadURLAll
Pos = Instr(BadURLAll, "?")
if Pos > 0 then
BadURLParam = Mid(BadURLAll,Pos)
BadURLPath = Mid(BadURLAll,1, Pos-1)
end if
if Right(BadURLPath,1) = "/" then
BadURLPath = Mid(BadURLPath,1, LEN(BadURLPath)-1)
end if
RedirectTo = ""
SELECT CASE BadURLPath
Case "/index.php?gid=6&pid=19" RedirectTo = "http://bodymindcompany.dk/shop/transportable-brikse-4c1.html"
Case "/index.php?gid=8&pid=19" RedirectTo = "http://bodymindcompany.dk/shop/stationaere-brikse-166c1.html"
Case "/index.php?gid=2&pid=40" RedirectTo = "http://bodymindcompany.dk/shop/massagestole-5c1.html"
Case "/index.php?gid=5&pid=19" RedirectTo = "http://bodymindcompany.dk/shop/tilbehoer-til-brikse-11s.html"
END SELECT
if RedirectTo <> "" then
Response.Status = "301 Moved Permanently"
Response.AddHeader "Location", RedirectTo
Response.End
else
%>
<html>
<head>
<title>Siden blev ikke fundet / The page you are looking for has been moved</title>
</head>
<body>
<center>
<h2>Siden blev ikke fundet / The page has been moved</h2><br><br>
</center>
</body>
</html>
<%end if%>
有人可以带我出去吗?
最好的
克劳斯·安徒生
【问题讨论】:
标签: redirect asp-classic