Wrox Home  
Search P2P Archive for: Go

  Return to Index  

security_asp thread: website redirection


Message #1 by "Monagle, Michael" <MMonagle@b...> on Fri, 21 Sep 2001 08:55:27 -0500
What's wrong with doing something like this:

<@Language=VBScript%>
<%
If Request.ServerVariables("HTTPS") = "off" then
    Response.Redirect("https://" & Request.ServerVariables("url"))
End If
%>

You could either do this on your 403 page, or you could have it as a
subroutine at the top of all your existing pages...

Cheers
Ken

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Monagle, Michael" <MMonagle@b...>
Subject: [security_asp] website redirection


: Hello,
:  I installed a certificate on a website of ours and now to get to it,
: you need to type https instead of http.  I have been asked to find a way
to
: redirect people to the new https address from the old http address--these
: addresses are identical except for the s.  I have found that if I change
the
: 403-4 webpage (this is the page that you are directed to by Internet
: Explorer if you don't type the s), that I can redirect them.  However, we
: have a page that was set up for clients to log in and check some of their
: information.  When I try to redirect them, IE gets stuck in an infinite
: redirection loop.  The 403-4 webpage that I rewrote is as follows:
:
: <%@ LANGUAGE="VBSCRIPT" %>
: <%
:  Option Explicit
: %>
: <%
: dim urlname
: urlname = lcase(Request.ServerVariables("url"))
:
: IF (urlname = "http://mywebsite.com/client.htm") or (urlname 
: "mywebsite.com/client.htm") THEN %>
: <meta http-equiv="refresh"
: content="0; url=https://mywebsite.com/client.htm">
: <% ELSE %>
: <meta http-equiv="refresh"
: content="0; url=https://mywebsite.com">
: <% END IF %>
: <html>
:
: <body>
: </body>
: </html>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


  Return to Index