client-side code to require ssl

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default client-side code to require ssl

    Hi everyone, I am looking for a way to require (redirect) users to access the
    page they are on via SSL. The reason why I want to do this on the client-side
    is because I don't have access to the server and also because I want to have
    portions of the web site that do not require secure access. Is there a way to
    do this through the application template? I am using CF 5, by the way. Thanks
    much, v_roma

    v_roma Guest

  2. Similar Questions and Discussions

    1. How to Post back page from Client side code?
      Hi, I am developing a website in ASP.NET. I want to have a client side code to confirm the deletion of some information from backend database. I...
    2. flashcom: client side cant access server side
      hi all, i hav install the flash com on the PC. It work well, on the server PC, i can access and log in to the 'chat room'.. however, if im...
    3. Request a Client-Side Certificate using ASP.NET Code
      (Type your message here) -------------------------------- From: surya Prakash Hi, for installing client certificate the conventionl method is...
    4. Controls with a client side onLoad function or seting a cursor server side
      Is there any way to create a web control that calls a client side onLoad function? Its diffucilt since you are not able to access the form or...
    5. button evet ---- server side - client side ???
      I want to use button. My question is that How can use server side and client site event at the same time. That is: I want to use button : when...
  3. #2

    Default Re: client-side code to require ssl

    How about putting this on pages that require SSL:

    <!--- If not in a https --->
    <cfif CGI.HTTPS EQ "off">
    <!--- Send it to the https --->
    <cflocation addtoken="no" url="https://#CGI.SERVER_NAME##CGI.SCRIPT_NAME#">
    </cfif>

    And this on pages that do not require SSl:

    <!--- If this page is in a https --->
    <cfif CGI.HTTPS EQ "on">
    <!--- Get it out of the https --->
    <cflocation addtoken="no" url="http://#CGI.SERVER_NAME##CGI.SCRIPT_NAME#">
    </cfif>


    --
    Ken Ford
    PVII Support Team
    [url]http://www.projectseven.com[/url]
    Team Macromedia Volunteer - Dreamweaver
    Certified Dreamweaver MX 2004 Developer


    "v_roma" <webforumsuser@macromedia.com> wrote in message news:d3m0dq$k5f$1@forums.macromedia.com...
    > Hi everyone, I am looking for a way to require (redirect) users to access the
    > page they are on via SSL. The reason why I want to do this on the client-side
    > is because I don't have access to the server and also because I want to have
    > portions of the web site that do not require secure access. Is there a way to
    > do this through the application template? I am using CF 5, by the way. Thanks
    > much, v_roma
    >

    Ken Ford - *TMM* & PVII Guest

  4. #3

    Default Re: client-side code to require ssl

    Thanks a lot, I'll give it a try. And what if I wanted to force https on a whole directory, could I use the application template? If so, how.
    v_roma Guest

  5. #4

    Default Re: client-side code to require ssl

    you'd have to tack on a '?' and #CGI.QUERY_STRING#
    JMGibson3 Guest

  6. #5

    Default Re: client-side code to require ssl

    Thanks. I actually just came across the following code: <CFIF CGI.SERVER_PORT
    eq '80'> <CFIF CGI.QUERY_STRING eq ''> <CFSET variables.query = ''> <cfelse>
    <CFSET variables.query = '?#CGI.QUERY_STRING#'> </CFIF> <CFLOCATION
    url='https://#CGI.SERVER_NAME##CGI.SCRIPT_NAME##variables.query #'
    addtoken='no'> <CFABORT> </CFIF> which, when added to the application page,
    redirects users to https for all pages under that application template.

    v_roma Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139