Created
May 8, 2017 14:34
-
-
Save kaushalp/7449b8c7c0e5545be91903f7606764dd to your computer and use it in GitHub Desktop.
HTTP to HTTPS Redirect using ASP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% | |
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 | |
%> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I don't understand the Else If on line 4. Both redirect commands, line 3 and line 5, are identical. Why would you do an else or an elseif to execute the same command?