Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > http or https

Reply
Thread Tools

http or https

 
 
shank
Guest
Posts: n/a
 
      01-22-2004
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


 
Reply With Quote
 
 
 
 
Ray at
Guest
Posts: n/a
 
      01-22-2004
REquest.ServerVariables("HTTPS") will never = "", so <> "" will always be
true. The value is either "on" or "off."

Ray at work

"shank" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
HTTP SOAP/HTTP GET/HTTP POST milan_9211 Software 0 01-10-2011 02:10 PM
server side redirect https => https NOT working Axel ASP General 8 04-27-2009 02:02 AM
https authentication & storing https page in string Naveen Dhanuka Ruby 1 09-19-2007 02:05 PM
open-uri and HTTPS, or net/https with a redirect jotto Ruby 4 10-02-2006 07:26 AM
HTTP to HTTPS aftab ASP .Net 2 10-03-2004 06:21 PM



Advertisments