Redirect users to https from http using Classic ASP

Use the following code at the beginning of the page to force a https connection:

if instr(Request.ServerVariables("SERVER_PORT"), "80") then
strURL = "https://" & Request.ServerVariables("SERVER_NAME") & "/" & Request.ServerVariables("PATH_INFO")
if Request.ServerVariables("QUERY_STRING") <> "" then strURL = strURL & "?" & Request.ServerVariables("QUERY_STRING")
response.redirect strURL
end if

All Rights Reserved. Reproduction in whole or part in any form or medium without specific written permission is prohibited.