navigate from a regular page to a secured page

Discussion in 'ASP General' started by c676228, Nov 29, 2007.

  1. c676228

    c676228 Guest

    Hi all,

    What is the best way to lead customer from a regular page to a secured page?
    Regularly, we use absolute path. say first ,a customer is on this regular
    page for general information: http://xxxdomain.com/index.html, then customer
    decides to buy something from our site. Then our program will provide an
    absolute path like this: https://xxxdomain.com/buy.asp.

    Recently I am doing migration and feel that the absolute path is not
    convenient for program migration and domain merge. So I am wodering if there
    is any other way to do it? any suggestions and comments?
    --
    Betty
    c676228, Nov 29, 2007
    #1
    1. Advertising

  2. "c676228" <> wrote in message
    news:...
    > Hi all,
    >
    > What is the best way to lead customer from a regular page to a secured

    page?
    > Regularly, we use absolute path. say first ,a customer is on this regular
    > page for general information: http://xxxdomain.com/index.html, then

    customer
    > decides to buy something from our site. Then our program will provide an
    > absolute path like this: https://xxxdomain.com/buy.asp.
    >
    > Recently I am doing migration and feel that the absolute path is not
    > convenient for program migration and domain merge. So I am wodering if

    there
    > is any other way to do it? any suggestions and comments?



    Since the start of the path changes from http to https what the client uses
    has to be an absolute path.

    It's a little bit awkard to do this in a html file since it gets no help
    server side.
    If you had a default.asp instead of index.html then :-

    Dim sSecureBase
    sSecureBase = "https://" & Request.ServerVariables("SERVER_NAME")

    >%


    <a href="<%=sSecureBase%>/buy.asp"> ... </a>


    If you have a lot of HTML that you don't want to change then you could leave
    buy.asp available as http://xxxdomain.com/buy.asp and use this code in the
    top :-

    If Request.ServerVariable("HTTPS") = "OFF" Then
    'Channel not secure
    Response.Redirect "https://" & _
    Request.ServerVariables("SERVER_NAME") & _
    Request.ServerVariables("UNENCODED_URL")
    Response.End
    End If

    You place this code in its own .asp file then include it in all ASP pages
    that should be secure.

    --
    Anthony Jones - MVP ASP/ASP.NET
    Anthony Jones, Nov 29, 2007
    #2
    1. Advertising

  3. c676228

    c676228 Guest

    Hi Anthony,
    Thank you so much for your response. I will take your second suggestion
    since we have separated person to develop marketing content without any
    knowledge about asp. With this piece of code, we can take care of any third
    party agents who link to our sale processes using http.

    Sincerely
    --
    Betty


    "Anthony Jones" wrote:

    > "c676228" <> wrote in message
    > news:...
    > > Hi all,
    > >
    > > What is the best way to lead customer from a regular page to a secured

    > page?
    > > Regularly, we use absolute path. say first ,a customer is on this regular
    > > page for general information: http://xxxdomain.com/index.html, then

    > customer
    > > decides to buy something from our site. Then our program will provide an
    > > absolute path like this: https://xxxdomain.com/buy.asp.
    > >
    > > Recently I am doing migration and feel that the absolute path is not
    > > convenient for program migration and domain merge. So I am wodering if

    > there
    > > is any other way to do it? any suggestions and comments?

    >
    >
    > Since the start of the path changes from http to https what the client uses
    > has to be an absolute path.
    >
    > It's a little bit awkard to do this in a html file since it gets no help
    > server side.
    > If you had a default.asp instead of index.html then :-
    >
    > Dim sSecureBase
    > sSecureBase = "https://" & Request.ServerVariables("SERVER_NAME")
    >
    > >%

    >
    > <a href="<%=sSecureBase%>/buy.asp"> ... </a>
    >
    >
    > If you have a lot of HTML that you don't want to change then you could leave
    > buy.asp available as http://xxxdomain.com/buy.asp and use this code in the
    > top :-
    >
    > If Request.ServerVariable("HTTPS") = "OFF" Then
    > 'Channel not secure
    > Response.Redirect "https://" & _
    > Request.ServerVariables("SERVER_NAME") & _
    > Request.ServerVariables("UNENCODED_URL")
    > Response.End
    > End If
    >
    > You place this code in its own .asp file then include it in all ASP pages
    > that should be secure.
    >
    > --
    > Anthony Jones - MVP ASP/ASP.NET
    >
    >
    >
    c676228, Nov 30, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. VB Programmer
    Replies:
    2
    Views:
    347
    Michael Evanchik
    Nov 10, 2003
  2. S.K. Dutta
    Replies:
    2
    Views:
    1,678
    LogicNP
    May 21, 2010
  3. Replies:
    1
    Views:
    465
    Nicole Calinoiu
    May 15, 2006
  4. Replies:
    0
    Views:
    108
  5. Daniel Frechette
    Replies:
    2
    Views:
    178
    Thomas 'PointedEars' Lahn
    Apr 10, 2006
Loading...

Share This Page