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

HTTP or HTTPS?

Participant ,
May 11, 2006 May 11, 2006

Copy link to clipboard

Copied

i'm trying to find a way to determine whether the current browser is runing over secure or not. I can't find anything that will detect the first part of the URL:
http:// or https://
but I can find everything after that!

I'm wondering if it's possible to interrogate IIS port number to see if the page is OR isn't running over port 80.

Any suggestions appreciated

)

jam
TOPICS
Advanced techniques

Views

525

Translate

Translate

Report

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

correct answers 1 Correct answer

Participant , May 12, 2006 May 12, 2006
Thanks Guys
All suggestions worked!
Now seeing as you both replied within 2 minutes of each other - i'm marking the response as tied!

Thanks very much!

Votes

Translate

Translate
Contributor ,
May 11, 2006 May 11, 2006

Copy link to clipboard

Copied

try <cfoutput>#cgi.server_port# and #cgi.server_port_secure#</cfoutput> I only run http and always/only see 80 and 0. I'd hope they'd change to 443 and 1 when https but have no way to test. Also CGI.HTTP_Referer begins with http but that's only where they started not what they clicked, might be a help though once in to https mode. You might also want to <cfdump var="#cgi#>. I think I recall there are other cgi's that cf doesn't display at the bottom when debug is turned on.

Votes

Translate

Translate

Report

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
Advocate ,
May 11, 2006 May 11, 2006

Copy link to clipboard

Copied

There's cgi.HTTPS, which should be either ON or OFF.

There's also cgi.SERVER_PORT which, for a default https site, is 443 and cgi.SERVER_PORT_SECURE which is either 1 (yes) or 0 (no).

Votes

Translate

Translate

Report

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 ,
May 12, 2006 May 12, 2006

Copy link to clipboard

Copied

LATEST
Thanks Guys
All suggestions worked!
Now seeing as you both replied within 2 minutes of each other - i'm marking the response as tied!

Thanks very much!

Votes

Translate

Translate

Report

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
Documentation