<%@ LANGUAGE="VBSCRIPT" %> <% on error resume next Dim cRobots, lRobot, aRobots Dim cParm, cDomain, cPage, cTest ' ' Update this value to the name of your homepage ' cHomePage = "/index.tpl" ' ' DO NOT MAKE ANY CHANGES BELOW THIS LINE ' Response.Status = "200 ok" cDomain = Replace(Request.ServerVariables("HTTP_HOST"),"local.", "") cDomain = Replace(cDomain,"www.","") set objXML = Server.CreateObject("MSXML2.ServerXMLHTTP") 'The QUERY_STRING variable should look like "404;" + full URL of page that doesn't exists 'Remove the 404, and the domain, leaving us with the page name cPage = Replace(Request.ServerVariables("QUERY_STRING"), "404;", "") cPage = Replace(cPage, ":80", "", 1, 1, 1) cPage = Replace(cPage, "http://", "", 1, 1, 1) cPage = Replace(cPage, "local.", "", 1, 1, 1) cPage = Replace(cPage, "www." & cDomain, "", 1, 1, 1) 'Now drop any parameters aPage = Split(cPage+"?","?") cPage = aPage(0) 'And check to see if this is a test if InStr(1, aPage(1), "test=1", 1) > 0 then cTest = 1 else cTest = "" end if 'Ask WebLinkAlliance if this is a Robot cParm = "?domain=www." & cDomain cParm = cParm & "&agent=" & Server.URLEncode(Request.ServerVariables("HTTP_USER_AGENT")) cParm = cParm & "&referer=" & Server.URLEncode(Request.ServerVariables("HTTP_REFERER")) cParm = cParm & "&address=" & Server.URLEncode(Request.ServerVariables("REMOTE_ADDR")) cParm = cParm & "&uri=" & cPage cParm = cParm & "&query=" & Server.URLEncode(Request.ServerVariables("QUERY_STRING")) cParm = cParm & "&test=" & cTest objXML.open "GET", "http://service.weblinkalliance.com/IsRobot.asp" & cParm, False objXML.send if inStr(1, objXML.responseText, "yes", 1) then objXML.open "GET", "http://service.weblinkalliance.com/default.asp" & cParm, False objXML.send Response.write(objXML.responseText) else Server.Transfer(cHomePage) end if %>