http or https

S

shank

I'm trying to detect if the user is utilizing HTTP or HTTPS in the address
bar.
The following code responds true regardless of whether I use HTTP or HTTPS.
What should I be using? In the end, if the user types in HTTP, I will
redirect them to HTTPS.

<%
If Request.Servervariables("https") <> "" Then
Response.Write "this is https...OK!!!"
End If
%>

thanks
 
R

Ray at

REquest.ServerVariables("HTTPS") will never = "", so <> "" will always be
true. The value is either "on" or "off."

Ray at work
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,241
Members
46,831
Latest member
RusselWill

Latest Threads

Top