SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    Procrastinator Extraordinaire lucas's Avatar
    Join Date
    Oct 2000
    Location
    Springfield, Missouri, U.S.A.
    Posts
    320
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How do I make sure a page is being accessed only through SSL (https)?

    I have a mix of secure and unsecure pages and want to make sure a particular login form is only accessed securely. I imagine there is probably a way for the server to force a directory to be secured but I would like to find a code solution to speed up development.

  2. #2
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Code:
    Dim secureCheck
    secureCheck = Request.ServerVariables("SERVER_PORT_SECURE")
    If secureCheck = 1 Then
      'secure stuff here
    Else
      'page isn't secure!
    End If

  3. #3
    Procrastinator Extraordinaire lucas's Avatar
    Join Date
    Oct 2000
    Location
    Springfield, Missouri, U.S.A.
    Posts
    320
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you are awesome.

  4. #4
    SitePoint Member
    Join Date
    May 2005
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to force to https

    How do I add this? I've tried and it doesn't work.

    Quote Originally Posted by vgarcia
    Code:
    Dim secureCheck
    secureCheck = Request.ServerVariables("SERVER_PORT_SECURE")
    If secureCheck = 1 Then
      'secure stuff here
    Else
      'page isn't secure!
    End If

  5. #5
    Original Gangster silver trophy Thing's Avatar
    Join Date
    Oct 2000
    Location
    Philadelphia, PA
    Posts
    4,708
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Let's see your code.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •