<% '獲取來源錯誤的HTML文件地址 refer = request.ServerVariables("QUERY_STRING") 'RTA新聞頁面地址有兩種格式: 'http://new.chinarta.com:80/html/difangnews_board/2010-9/2010927144636.htm,較新的格式; 'http://new.chinarta.com:80/html/dlysyw_board/20054175010.htm,較老的格式; existValue = false Set fso = Server.CreateObject("Scripting.FileSystemObject") if Instr(1,refer,".htm") <> 0 and Instr(1,refer,"/html/") <> 0 then '為老版網站的新聞路徑 if Instr(1,refer,"-") <>0 then '較新格式的新聞; refer = right(refer,len(refer)-Instr(1,refer,"-")+6) fileExist = Server.MapPath("html"&refer) If fso.FileExists(fileExist) Then existValue = true end if else '較老的新聞格式,不帶年月; refer = right(refer,20) refer = right(refer,len(refer)-Instr(1,refer,"/")) year_1 = left(refer,4) month_1= left(right(refer,len(refer)-4),1) month_2= left(right(refer,len(refer)-4),2) fileName_1 = "html/"&year_1&"-"&month_1&"/"&refer fileName_2 = "html/"&year_1&"-"&month_2&"/"&refer fileExist_1 = Server.MapPath(fileName_1) fileExist_2 = Server.MapPath(fileName_2) If fso.FileExists(fileExist_1) Then refer = "/"&year_1 &"-"&month_1&"/"&refer existValue = true elseif fso.FileExists(fileExist_2) then refer = "/"&year_1 &"-"&month_2&"/"&refer existValue = true else existValue = false end if end if Set fso = Nothing end if if existValue then refer = "/html"&refer response.redirect(refer) else %>
頁面不存在,點擊返回首頁
<%end if%> 彩神app苹果{{转码主词}官网{{转码主词}网址