<% '****************************************************************' ' IP Delivery .asp version version 4.21' ' last modified 03/27/06' ' Copyright (C) 1997-2006 Beyond Engineering' ' All Rights Reserved' ' Resale and distribution strictly prohibited' ' Note: Users of this script must have a purchase agreement on' ' file with Beyond Engineering. ' ' IP Delivery is a trademark of Beyond Engineering ' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' ' ' SETUP ' ' You will need to modify this section to fit your settings ' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 'SPECIFY THE DIRECTORY THAT THE TEMPLATE FILES ARE AT ' 'You will need the trailing "\" ' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' TemplatePath = "D:\Domains\westchesterwildlife.com\wwwroot\content\" IPpath = "D:\Domains\westchesterwildlife.com\wwwroot\IPSfile\" '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 'PAGE ASSIGNMENTS. THESE FILES MUST BE IN THE PATH INDICATED ' 'PREVIOUSLY BY 'TemplatePath' ABOVE. ' '************************* NOTE *****************************' 'IF A PAGE ASSIGNMENT IS A WEB ADDRESS STARTING WITH "HTTP:" ' 'THEN THE SCRIPT WILL PERFORM A REDIRECT INSTEAD ' 'YOU WOULD USE THIS FEATURE IF YOU WANTED TO REDIRECT NORMAL ' 'BROWSERS TO AN ASP PAGE FOR PROCESSING. ' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Normal_Page = "http://www.westchesterwildlife.com/index.html" Generic_Page = "http://www.westchesterwildlife.com/index.html" MSN_Page = "mousecontrol-1.htm" Ask_Page = "mousecontrol-1.htm" Yahoo_Page = "mousecontrol-1.htm" Google_Page = "mousecontrol-1.htm" IPFile= "ips42.txt" '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 'DETERMINE IF YOU WANT TO ACTIVATE BROWSER DETECTION OR NOT ' 'DetectBrowsers = FALSE 'Do not detect browsers (For Testing)' 'DetectBrowsers = TRUE 'Detect Browsers (When Live) ' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' DetectBrowsers = TRUE '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' ' ' END SETUP ' ' You will not need to change anything beyond this point. ' '****************************************************************' '****************************************************************' ' ' ' MAIN PROGRAM - DO NOT MODIFY! ' ' ' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' SET fso = CreateObject("Scripting.FileSystemObject") GoOn = TRUE IF NOT DetectBrowsers THEN '# bypass browser checking '# assign generic FoodFile just IN case FoodFile = generic_page ELSEIF LEN(TRIM(Request.ServerVariables("HTTP_VIA")&Request.ServerVariables("HTTP_REFERER"))) > 0 THEN '# this is definitely NOT a search engine robot - proxy check check_engine=99 redirect() GoOn = FALSE ELSEIF InStr(UCase(Request.ServerVariables("HTTP_CONNECTION")),"ALIVE") > 0 and NOT InStr(Request.ServerVariables("HTTP_FROM"),"at") > 0 THEN '# this is NOT search engine robot check_engine=99 redirect() GoOn = FALSE ELSEIF InStr(UCase(Request.ServerVariables("HTTP_PRAGMA")),"NO-CACHE") > 0 and NOT InStr(Request.ServerVariables("HTTP_FROM"),"at") > 0 THEN '# this is NOT search engine robot check_engine=99 redirect() GoOn = FALSE '# added to check for go translator ELSEIF InStr(UCase(Request.ServerVariables("HTTP_RANGE")),"BYTES") > 0 THEN '# this is NOT search engine robot check_engine=99 redirect() GoOn = FALSE '# end go translator check ELSE '# assign generic FoodFile just IN case FoodFile=generic_page END IF IF GoOn THEN IF fso.FileExists(IPpath & IPFile) THEN SET ReadIPFile = fso.OpenTextFile(IPpath & IPFile,1,0) DIM engines REDIM engines(0) count = 0 DO UNTIL ReadIPFile.AtENDOfStream engines(count) = ReadIPFile.Readline count = count + 1 REDIM Preserve engines(count) LOOP ReadIPFile.Close check_url() redirect() ELSE msg = "

Cannot open file for reading!


" Response.Write(msg) END IF END IF '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' ' ' END MAIN PROGRAM ' ' ' '****************************************************************' '****************************************************************' ' ' ' FUNCTIONS ' ' ' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' SUB check_url IF LEN(Trim(Request.ServerVariables("REMOTE_ADDR"))) > 0 THEN FOR EACH member IN engines IF LEN(TRIM(member)) > 0 THEN 'DETERMINE IF IP ADDRESS IN FILE IS SPECIFIC OR A RANGE TEMP = TRIM(MID(member,InStrRev(member,":")+1)) 'GRAB THE REMOTE_ADDR RemAddr = Request.ServerVariables("REMOTE_ADDR") 'IF THERE'S A WILDCARD If InStr(Temp,"*")>0 then 'THEN GRAB THE PART BEFORE THE WILDCARD Temp = Left(Temp, InStr(Temp,"*")-1) 'AND ONLY COMPARE THE PARTIAL ADDRESS RemAddr = LEFT(RemAddr,LEN(TEMP)) End If if RemAddr = Temp Then check_engine = 1 IF InStr(member,"msn")>0 THEN FoodFile=msn_page ELSEIF InStr(member,"yahoo")>0 THEN FoodFile=yahoo_page ELSEIF InStr(member,"ask")>0 THEN FoodFile=ask_page ELSEIF InStr(member,"google")>0 THEN FoodFile=google_page ELSEIF InStr(member,"normal")>0 THEN FoodFile=normal_page ELSE FoodFile=generic_page END IF END IF END IF NEXT ELSE check_engine = 1 '# generic FoodFile is already assigned, but... FoodFile = generic_page END IF IF lcase(LEFT(foodfile,5))<>"http:" AND NOT (fso.FileExists(TemplatePath & FoodFile)) THEN FoodFile = normal_page END IF END SUB SUB redirect IF check_engine = 99 THEN FoodFile = normal_page END IF IF lcase(LEFT(foodfile,5))="http:" THEN Response.Redirect foodfile ELSE IF (fso.FileExists(TemplatePath & FoodFile)) THEN SET FoodFile = fso.OpenTextFile(TemplatePath & FoodFile,1,0) response.Write(FoodFile.ReadAll) FoodFile.Close ELSE msg = "
" & TemplatePath & FoodFile & " Doesn't exist." Response.Write(msg) END IF END IF END SUB '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' ' ' END FUNCTIONS ' ' ' '****************************************************************' %>