Function iif(condition, ontrue, onfalse) If condition Then iif = ontrue Else iif = onfalse End If End Function Function buildRequestURL() buildRequestURL = iif(Request.ServerVariables("HTTPS") = "on", "https", "http") & "://" _ & Request.Servervariables("SERVER_NAME") _ & iif(Request.ServerVariables("SERVER_PORT") = "80", "", ":" _ & Request.ServerVariables("SERVER_PORT")) _ & Request.ServerVariables("SCRIPT_NAME") _ & "?" & Request.ServerVariables("QUERY_STRING") End Function