Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

did page request HTTPS or HTTP version of my page ?

Participant ,
Apr 08, 2011 Apr 08, 2011

is there a way to check if a page on my site was requested with HTTP or HTTPS ?

I only want to respond if I know the page was requested as:

https://www.mysite.com/mypage.cfm ?

581
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 08, 2011 Apr 08, 2011

You can look in the CGI scope to find this and many other things. These may slightly vary from one server to another, as they're dependent on web server software, but there's one called CGI.HTTPS and another called CGI.SERVER_PORT.

Dave Watts, CTO, Fig Leaf Software

http://www.figleaf.com/

http://training.figleaf.com/

Dave Watts, Eidolon LLC
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Apr 08, 2011 Apr 08, 2011

I couldn't find anything on the Coldfusion forum, but I've managed to find something on House Of Fusion.

Would the following be correct ?

<cfif #cgi.server_port_secure# EQ 1>

  HTTPS

<cfelse>

  HTTP

</cfif>

expanding it further, is the following also valid ?

<cfif #cgi.server_port_secure# EQ 1 AND structKeyExists (form,"password")>

  HTTPS

<cfelse>

HTTP

</cfif>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Apr 08, 2011 Apr 08, 2011
LATEST

Better:

HTTP

</cfif

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources