I.T. Discussion Community!
-Collapse +Expand
ASP Classic
Search ASP Classic Group:

-Collapse +Expand ASP Classic Store

Prestwood eMagazine

January Edition
Subscribe now! It's Free!
Enter your email:

   ► MB LobbyASP Classic Coding BoardASP Classic Coding Topic   Print This     

https to http

https to http in ASP Classic Coding topic (part of our ASP Classic Coding group).

Quick Search: https http  
-- UNK
I sent this via email, I'm reposting here just incase.Wink

I  have a question regarding redirect of https to http.
Mike posted a great example of http to https,how ever I need it the other way around.
Can I change the code "off" to "on" and change the https to http?
Yes, I know I can test this however, I'm not sure where to put the code.
My problem is once a user enters https they remain in https even on pages which are http. I have many pages that are not http and just as many https pages.
Would I have to put the code on all of the http pages?
<%if Request.ServerVariables("https") = "off" Then
Response.redirect("https://" & Request.ServerVariables("http_HOST") &
End if
 Posted 11 years ago (Thread Starter)
Comment Quote
About debra_owens -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.

Post ID #13520, 1 replies
Thread Started 6/3/2009 7:28:28 AM
View Counter=3517
Last Reply Posted 2/1/2010 8:03:53 PM)
Location=-- UNK 
Joined=11 years ago   MB Posts=1  
Most Recent Post
Mike Prestwood
Prestwood IT
Prestwood IT office in Citrus Heights, CA

Hi Debra,

Here are my three routines from my generic SysUtils library I maintain:

Function SU_IsHTTPSOn
 If LCase(Request.ServerVariables("HTTPS")&"") = "on" Then
  SU_IsHTTPSOn = True
  SU_IsHTTPSOn = False
 End If
End Function
  If Len(Request.ServerVariables("QUERY_STRING")) > 0 Then
   SU_Redirect "http://" & Request.ServerVariables("server_name") & _
       Request.ServerVariables("PATH_INFO") & "?" _
         & Request.ServerVariables("QUERY_STRING")
   SU_Redirect "http://" & Request.ServerVariables("server_name") & _
  End If
 End If
End Sub
' HOME_URL is the default SSL server.
 If Enable_SSL = True Then
  If Not SU_IsHTTPSOn Then
   If LCase(Request.ServerVariables("server_name")) <> "localhost" Then
    If Len(Request.ServerVariables("QUERY_STRING")&"") > 0 Then
     SU_Redirect "https://" & SSL_URL & Request.ServerVariables("PATH_INFO") _
           & "?" & Request.ServerVariables("QUERY_STRING")
     SU_Redirect "https://" & SSL_URL & Request.ServerVariables("PATH_INFO")
    End If
   End If
  End If
 End If
End Sub

Mike Prestwood
Prestwood IT Solutions

 Posted 10 years ago
Comment Quote
About Mike Prestwood -Collapse +Expand
Visit Profile
Approved member.
Member subscribes to this thread with a verified email.
About Mike Prestwood

Mike Prestwood is a drummer, an author, and creator of the PrestwoodBoards online community. He is the President & CEO of Prestwood IT Solutions. Prestwood IT provides Coding, Website, and Computer Tech services. Mike has authored 6 computer books and over 1,200 articles. As a drummer, he maintains play-drums.com and has authored 3 drum books. If you have a project you wish to discuss with Mike, you can send him a private message through his PrestwoodBoards home page or call him 9AM to 4PM PST at 916-726-5675 x205.

Web Presence
Facebook, Prestwood IT Facebook page -- fan page. (Visit Me)
Twitter, Follow Prestwood IT on Twitter. (Visit Me)
LinkedIn, Prestwood IT company page on LinkedIn. (Visit Me)
YouTube, Prestwood IT YouTube Channel (Visit My Channel)
Website, My drum website where I sell my drum books. (http://www.play-drums.com)

Post ID #13926 (Level 1.1)  Reply to 13520
Thread Started 2/1/2010 8:01:10 PM
Location=Prestwood IT office in Citrus Heights, CA 
Joined=20 years ago   MB Posts=1410   KB Posts=1805   KB Comments=69   BLOG, Topics=4  

Revive Thread!

Add a comment to revive this old thread and make this archived thread more useful.

Write a Comment...
Full Editor
Sign in...

If you are a member, Sign In. Or, you can Create a Free account now.

Anonymous Post (text-only, no HTML):

Enter your name and security key.

Your Name:
Security key = P1213A1
Enter key:
Icon: A Post    Thread    Idea    Important!    Cool    Sad    No    Yes    Includes a Link...   
Thread #13520 Counter
Since 6/3/2009

Follow PrestwoodBoards on: 

©1995-2020 PrestwoodBoards  [Security & Privacy]
Professional IT Services: Coding | Websites | Computer Tech