Forcing SSL with custom error messages
Forcing SSL with custom error messages
am 02.02.2006 23:03:34 von Just1Coder
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
%>
Re: Forcing SSL with custom error messages
am 03.02.2006 08:50:14 von Ken Schaefer
"J1C" 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
Re: Forcing SSL with custom error messages
am 17.02.2006 16:56:21 von Just1Coder
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?
Re: Forcing SSL with custom error messages
am 21.02.2006 01:41:52 von Ken Schaefer
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" 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?
:
Re: Forcing SSL with custom error messages
am 24.02.2006 05:21:43 von Just1Coder
Yes... I caught that right after I posted :) Thanks Ken.
Cheers