> 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!)
::::::::::::::::::::::::::::::::::::::::::::::::::::::

______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.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