http or https

Discussion in 'ASP General' started by shank, Jan 22, 2004.

  1. shank

    shank Guest

    I'm trying to detect if the user is utilizing HTTP or HTTPS in the address
    bar.
    The following code responds true regardless of whether I use HTTP or HTTPS.
    What should I be using? In the end, if the user types in HTTP, I will
    redirect them to HTTPS.

    <%
    If Request.Servervariables("https") <> "" Then
    Response.Write "this is https...OK!!!"
    End If
    %>

    thanks
    shank, Jan 22, 2004
    #1
    1. Advertising

  2. shank

    Ray at Guest

    REquest.ServerVariables("HTTPS") will never = "", so <> "" will always be
    true. The value is either "on" or "off."

    Ray at work

    "shank" <> wrote in message
    news:...
    > I'm trying to detect if the user is utilizing HTTP or HTTPS in the address
    > bar.
    > The following code responds true regardless of whether I use HTTP or

    HTTPS.
    > What should I be using? In the end, if the user types in HTTP, I will
    > redirect them to HTTPS.
    >
    > <%
    > If Request.Servervariables("https") <> "" Then
    > Response.Write "this is https...OK!!!"
    > End If
    > %>
    >
    > thanks
    >
    >
    Ray at, Jan 22, 2004
    #2
    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. aftab

    HTTP to HTTPS

    aftab, Sep 28, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    3,364
    Leon Mayne [MVP]
    Oct 3, 2004
  2. Raymond Tam

    HTTPS to HTTP

    Raymond Tam, Aug 5, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    565
    Marco Scheel
    Aug 6, 2003
  3. Axel
    Replies:
    8
    Views:
    1,067
    Adrienne Boswell
    Apr 27, 2009
  4. jotto
    Replies:
    4
    Views:
    375
    jotto
    Oct 2, 2006
  5. Naveen Dhanuka
    Replies:
    1
    Views:
    266
Loading...

Share This Page