how to use SSL with asp/vbscript

Discussion in 'ASP General' started by Dean g, Mar 23, 2005.

  1. Dean g

    Dean g Guest

    I'm complety new to ssl so this is a total newbie question, the isp i'm
    using has authorized ssl on my site but i dont know how to tell a
    particular page that it can only be run as a secure page... Where at the
    moment u can view the page as https or http.
    I'm assuming i need some code to detect whether its being run as a https
    and if not redirect it to https.

    surprisingly i couldnt find much info about this online so any
    assistance would be appreciated.
    Dean


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Dean g, Mar 23, 2005
    #1
    1. Advertising

  2. Dean g

    Adam Short Guest

    You can embed a check in your ASP code. Put it at the top!

    <%
    if UCase(Request.ServerVariables("HTTPS")) = "OFF" then response.redirect
    "https://www.yourdomain.com/yourpage.asp"
    %>

    Hope this helps.

    Adam

    "Dean g" <> wrote in message
    news:...
    > I'm complety new to ssl so this is a total newbie question, the isp i'm
    > using has authorized ssl on my site but i dont know how to tell a
    > particular page that it can only be run as a secure page... Where at the
    > moment u can view the page as https or http.
    > I'm assuming i need some code to detect whether its being run as a https
    > and if not redirect it to https.
    >
    > surprisingly i couldnt find much info about this online so any
    > assistance would be appreciated.
    > Dean
    >
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it!
    Adam Short, Mar 23, 2005
    #2
    1. Advertising

  3. Dean g

    Dean g Guest

    Thanks adam thats exactly what i need.
    i appreciate the help
    Dean
    ----------------------------------------------------------------------
    From: Adam Short

    You can embed a check in your ASP code. Put it at the top!

    <%
    if UCase(Request.ServerVariables("HTTPS")) = "OFF" then
    response.redirect
    "https://www.yourdomain.com/yourpage.asp"
    %>

    Hope this helps.

    Adam


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Dean g, Mar 23, 2005
    #3
  4. Gazing into my crystal ball I observed
    jitendra<> writing in
    news::

    > You can also use this code
    >
    > If Request.ServerVariables("SERVER_PORT")=80 Then
    > Dim strSecureURL
    > strSecureURL = "https://"
    > strSecureURL = strSecureURL &
    > Request.ServerVariables("SERVER_NAME") strSecureURL =
    > strSecureURL & Request.ServerVariables("URL") Response.Redirect
    > strSecureURL
    > End If
    >
    > From
    > http://www.google.co.in/search?hl=en&rlz=1B3GGGL_enIN295IN295

    &q=How+To+
    > Use+SSL+With+Asp/vbscript&start=10&sa=N
    >
    > Posted via DevelopmentNow.com Groups
    > http://www.developmentnow.com/g/


    Do you realize you're replying to a post from 2005? I guess better late
    than never!

    --
    Adrienne Boswell at Home
    Arbpen Web Site Design Services
    http://www.cavalcade-of-coding.info
    Please respond to the group so others can share
    Adrienne Boswell, Oct 1, 2009
    #4
    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. 620
    Replies:
    2
    Views:
    987
    Murat Tunaboylu
    Jan 6, 2004
  2. CW
    Replies:
    2
    Views:
    506
  3. Sean Wolfe
    Replies:
    1
    Views:
    2,240
    Joerg Jooss
    Apr 28, 2005
  4. Nathan Crosby

    ASP.net SSL w/ an SSL Accelerator

    Nathan Crosby, Jul 25, 2006, in forum: ASP .Net Security
    Replies:
    2
    Views:
    186
    Nathan Crosby
    Aug 18, 2006
  5. dinamointer
    Replies:
    5
    Views:
    254
    Randy Webb
    May 12, 2006
Loading...

Share This Page