How to determine if an SSL page is in ASP?

How do I know if an SSL'd page is in a "classic" ASP? It is not possible to use javascript because what I output is the result of the "noscript" tag .: D

Unable to change or change in IIS - must be in the script file itself.

eg. https: //foobar/something.asp β†’ should say YES http: //foobar/something.asp β†’ should say NO

+4
source share
2 answers

You can get this information through

Request.ServerVariables("HTTPS") 

See here for more details.

+7
source

I used this to change the links to https links to avoid weird IE messages:

 <% dim socket If Request.ServerVariables("HTTPS") = "on" then socket = "https" else socket = "http" End if %> 

Then

  <img src="<%response.write(socket)%>://website.com/images/logo.png" class="logo" alt="logo" /> 
+3
source

All Articles