There are many situations where you’d want a site to be accessible only securely, and there are several resources online on how to accomplish this. Unfortunately, I couldn’t find a perfect solution for me. Influenced by this info and following the steps outlined here (under In Windows Server 2003 (IIS 6.0)), I came up with the following:
If Request.ServerVariables(“SERVER_PORT”)=80 Then
strSecureURL = Replace(Request.QueryString,”http”,”https”) ‘ entire old URL, but w/https
strSecureURL = Replace(strSecureURL,”403;”,”") ‘ remove “403;” from beginning
strSecureURL = Replace(strSecureURL,”:80″,”") ‘ remove port # that’s appended to server name
It works well for my purposes, but of course, your mileage may vary.