Skip to content

Instantly share code, notes, and snippets.

@kaushalp
kaushalp / httpsRedirect.vb
Created May 8, 2017 14:34
HTTP to HTTPS Redirect using ASP
<%
If Request.ServerVariables("HTTPS") = "off" Then
Response.Redirect "https://" & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("UNENCODED_URL")
ElseIf Request.ServerVariables("HTTPS") = "on" Then
Response.Redirect "https://" & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("UNENCODED_URL")
End If
%>