Welcome to WebmasterWorld Guest from 54.198.60.39

Forum Moderators: ocean10000

Message Too Old, No Replies

Forcing http into https

     
2:51 pm on Dec 20, 2004 (gmt 0)

Junior Member

10+ Year Member

joined:July 15, 2003
posts:51
votes: 0


I have developed a cms backend where it uses https, but images / text that are relevant are in http so i keep getting "You are about to view unsecure items" is there a way of forcing the http items into https or a way of stopping this popup?
4:35 pm on Dec 20, 2004 (gmt 0)

Senior Member

WebmasterWorld Senior Member txbakers is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Sept 1, 2001
posts:4392
votes: 0


move the images into the same directory.

The links for the images are outside of the https and are causing that.

also use relative paths.

4:40 pm on Dec 20, 2004 (gmt 0)

Junior Member

10+ Year Member

joined:July 15, 2003
posts:51
votes: 0


The images are relevant to the site which isnt https :(

How would i go about making the paths relevant?

4:41 pm on Dec 20, 2004 (gmt 0)

Junior Member

10+ Year Member

joined:July 15, 2003
posts:51
votes: 0


sorry i meant relative :)
4:42 pm on Dec 20, 2004 (gmt 0)

Senior Member

WebmasterWorld Senior Member txbakers is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Sept 1, 2001
posts:4392
votes: 0


maybe make two sets of images then? You need to make the https a self-contained unit.
4:54 pm on Dec 20, 2004 (gmt 0)

Junior Member

10+ Year Member

joined:July 15, 2003
posts:51
votes: 0


We are talkin about 1000s of packshots, which due to capacity couldnt be doubled. Is there an easy approach to relative paths?
9:38 pm on Dec 20, 2004 (gmt 0)

Junior Member

10+ Year Member

joined:Nov 25, 2003
posts:107
votes: 0


Sorry - clarification. Two seperate sites, or two seperate *servers*?

Is it all physically on one machine?

10:30 pm on Dec 20, 2004 (gmt 0)

Full Member

10+ Year Member

joined:May 15, 2002
posts:236
votes: 0


For images siting on the same server and sharing same certificate you can enforce to SSL but if you have two different directories/servers you need to get certificate

to enforce SSL
Private Sub EnforceSSL()
'localhost '
If LCase(Trim(Request.ServerVariables("SERVER_NAME"))) <> "localhost" Then
If Request.ServerVariables("SERVER_PORT") = 80 Then
'check if requested page requires SLL
Dim strSecureURL As String
strSecureURL = "https://"
strSecureURL = strSecureURL & Request.ServerVariables("SERVER_NAME")
strSecureURL = strSecureURL & Request.ServerVariables("URL")
strSecureURL = strSecureURL & "?" & Request.ServerVariables("QUERY_STRING")
Response.Redirect(strSecureURL)
End If

End If

End Sub
'
Private Sub NonSSL()
If Request.ServerVariables("SERVER_PORT") <> 80 Then
Dim strNonSSLURL As String
strNonSSLURL = "http://"
strNonSSLURL = strNonSSLURL & Request.ServerVariables("SERVER_NAME")
strNonSSLURL = strNonSSLURL & Request.ServerVariables("URL")
strNonSSLURL = strNonSSLURL & "?" & Request.ServerVariables("QUERY_STRING")
Response.Redirect(strNonSSLURL)
End If
End Sub

9:02 am on Dec 21, 2004 (gmt 0)

Junior Member

10+ Year Member

joined:July 15, 2003
posts:51
votes: 0


Yes the images / site are on one physical machine!

I have will have a look at trying your code cheers :)