'--------------------------------------------------------------------------- ' function: sysdetermine301redirhostandprotocol ' parameters: none '--------------------------------------------------------------------------- ' system function - determines the primary and destination host ' (e.g. www.mysite.com or mysite.com ) and protocol ' http:// for port 80 and https:// for port 443 '--------------------------------------------------------------------------- sub sysdetermine301redirhostandprotocol() dim sprimarysitehost sprimarysitehost = lcase(gs301homehost) sprimarysitehost = replace(sprimarysitehost,"http://","") sprimarysitehost = replace(sprimarysitehost,"https://","") if right(sprimarysitehost,1) = "/" then sprimarysitehost = left(sprimarysitehost,len(sprimarysitehost)-1) end if gs301redirecthost = sprimarysitehost if request.servervariables("SERVER_PORT") = 80 then gs301redirectprotocol = "http://" end if if request.servervariables("SERVER_PORT") = 443 then gs301redirectprotocol = "https://" end if end sub