| Author |
Forcing SSL with custom error messages
|
|
|
| I followed David Wang's instructions but for some reason I can not get
past the redirect... It does fire from HTTP to HTTPS without any
trouble ... but it just sits on the error page ...
<%
if request.servervariables("server_port") = 80 then
dim sslurl : sslurl = "https://"
sslurl = sslurl & request.servervariables("server_name")
sslurl = sslurl & request.servervariables("url")
response.redirect sslurl
end if
%>
| |
| Ken Schaefer 2006-02-03, 2:54 am |
|
"J1C" <just1coder@yahoo.ca> wrote in message
news:1138917813.987660.285660@g14g2000cwa.googlegroups.com...
:I followed David Wang's instructions but for some reason I can not get
: past the redirect... It does fire from HTTP to HTTPS without any
: trouble ... but it just sits on the error page ...
If it's just sitting on the error page, how is the transition to HTTPS
occuring?
I'm a bit confused as to what you are actually seeing.
Cheers
Ken
| |
|
| I did it a little differently and this seems to work:
<%
if request.servervariables("https") = "off" then
response.redirect "https://" & request.servervariables("http_host")
end if
%>
It looks like querystrings get ripped off though - any way to fix that?
| |
| Ken Schaefer 2006-02-20, 8:48 pm |
| Request.ServerVariables("HTTP_Host") only contains the Host name.
Request.ServerVariables("QueryString") will contain the querystrings.
And you'll probably want the page name as well...
Cheers
Ken
"J1C" <just1coder@yahoo.ca> wrote in message
news:1140191781.717597.315030@g47g2000cwa.googlegroups.com...
:I did it a little differently and this seems to work:
:
: <%
: if request.servervariables("https") = "off" then
: response.redirect "https://" & request.servervariables("http_host")
: end if
: %>
:
: It looks like querystrings get ripped off though - any way to fix that?
:
| |
|
| Yes... I caught that right after I posted Thanks Ken.
Cheers
|
|
|
|