'--------------------------------------------------------------------------- ' sub: syscheckisprimaryhost ' parameters: none '--------------------------------------------------------------------------- ' system function - checks if the site host is the same as the primary host ' a 301 redirect should be initiated if the function returns true, because ' there is either a canonical-url or multiple domains for the same site problem '--------------------------------------------------------------------------- sub syscheckisprimaryhost() dim sprimarysitehost, scurrenthost sprimarysitehost = lcase(gs301homehost) sprimarysitehost = replace(sprimarysitehost,"http://","") if right(sprimarysitehost,1) = "/" then sprimarysitehost = left(sprimarysitehost,len(sprimarysitehost)-1) end if scurrenthost = lcase(request.servervariables("HTTP_HOST")) if right(scurrenthost,1) = "/" then scurrenthost = left(scurrenthost,len(scurrenthost)-1) end if if scurrenthost <> sprimarysitehost then gs301redirectpathandscript = request.servervariables("SCRIPT_NAME") gs301redirectqs = request.querystring gb301redirect = true 'start immediate redirection code call sysexec301redirect() response.end 'end of immediate redirection code end if end sub