Here is a snippet of ASP code that will allow dynamic redirects from HTTP to HTTPS on your Alentus Hosted Webpage:
<%
Dim strQUERY_STRING
Dim strSecureURL
Dim strWork
' Get server variables
strQUERY_STRING = Request.ServerVariables("QUERY_STRING")
' Fix the query string:
strWork = Replace(strQUERY_STRING,"http","https")
strWork = Replace(strWork,"403;","")
strWork = Replace(strWork,":80","")
' Now, set the new, secure URL:
strSecureURL = strWork
Response.Redirect(strSecureURL)
%>
NOTE:
make sure to set "require secure channel" ON under directory security
for the website on IIS and set it OFF on the actual file that is running
the code for the custom error redirect (eg. redirect.asp)
Article ID: 270, Created: March 8, 2011 at 5:37 PM, Modified: January 7, 2013 at 1:56 PM