Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsWindows Server 2003Windows 2000Windows NTSmall Business ServerVirtual ServerExchange ServerIISHost Integration ServerISA ServerSMSWSUSMOMWindows Media ServerSecurityCertification
Related Topics
SQL ServerMS WindowsMS OfficePC HardwareMore Topics ...

Windows Server Forum / IIS / IIS Security / February 2006

Tip: Looking for answers? Try searching our database.

Forcing SSL with custom error messages

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
J1C - 02 Feb 2006 22:03 GMT
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 - 03 Feb 2006 07:50 GMT
: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
J1C - 17 Feb 2006 15:56 GMT
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 - 21 Feb 2006 00:41 GMT
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

:I did it a little differently and this seems to work:
:
[quoted text clipped - 5 lines]
:
: It looks like querystrings get ripped off though - any way to fix that?
J1C - 24 Feb 2006 04:21 GMT
Yes... I caught that right after I posted :) Thanks Ken.

Cheers
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.