how to get CGI.HTTPS? is not one of the variable i can get from CF / apache

makwl

-----Original Message-----
From: Dave Watts [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 23, 2002 2:11 PM
To: '[EMAIL PROTECTED]'
Cc: '[EMAIL PROTECTED]'
Subject: RE: forced user to access https page


> how can i force my users to access HTTPS pages on my CF 
> application even they type HTTP at the URL address on 
> the browser? example if user type http://www.myapp.com 
> i want to redirect them to https://www.myapp.com taht 
> including all the CF pages they access, should i do 
> something on the apache server setting or should i put 
> some coding on the CF pages??

You can just put something like this in your Application.cfm file:

<cfif not Len(CGI.HTTPS)>
        <cfset myurl = CGI.SERVER_NAME & CGI.SCRIPT_NAME>
        <cfif Len(CGI.QUERY_STRING)>
                <cfset myurl = myurl & "?" & CGI.QUERY_STRING>
        </cfif>
        <cflocation url="https://#myurl#";>
</cfif>

Alternatively, there's probably some way to do this in Apache, too. I'd look
at the Redirect directive. I wouldn't be surprised if something like this
worked:

Redirect / https://www.myapp.com/

http://www.lists.aldigital.co.uk/apache-ssl/msg03385.html

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444

::::::::::::: dream :: design :: develop :::::::::::::
MXDC 02 :: Join us at this all day conference for 
designers & developers to learn tips, tricks, best 
practices and more for the entire Macromedia MX suite.

September 28, 2002  ::  http://www.mxdc02.com/
(Register today, seats are limited!)
::::::::::::::::::::::::::::::::::::::::::::::::::::::


______________________________________________________________________
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to