You should run the following code, and convince yourself that the URLs are accessible, by opening each in a browser:
<cfoutput>
https://www.site.com#CGI.SCRIPT_NAME# <br>
https://#CGI.SERVER_NAME##CGI.SCRIPT_NAME# <br>
http://www.site.com#CGI.SCRIPT_NAME#
</cfoutput>
I used below code. its working perfectly. thanks a lot.
<cfif (CGI.SERVER_NAME EQ "site.com") and (CGI.https NEQ "on")>
<cfheader statuscode="301" statustext="Moved permanently">
<cfheader name="Location" value="https://www.site.com#CGI.SCRIPT_NAME#">
</cfif>
<cfif (CGI.SERVER_NAME EQ "www.site.com") and (CGI.https NEQ "on")>
<cfheader statuscode="301" statustext="Moved permanently">
<cfheader name="Location" value="https://www.site.com#CGI.SCRIPT_NAME#">
</cfif>
<cfif CGI.SERVER_NAME EQ "site.com">
<cfheader statuscode="301" statustext="Moved permanently">
<cfheader name="Location" value="http://www.site.com#CGI.SCRIPT_NAME#">
</cfif>