homepage Welcome to WebmasterWorld Guest from 54.227.215.139
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
Forum Library, Charter, Moderators: ocean10000

Microsoft IIS Web Server and ASP.NET Forum

    
Forcing http into https
infernofiasco

10+ Year Member



 
Msg#: 2360 posted 2:51 pm on Dec 20, 2004 (gmt 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?

 

txbakers

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



 
Msg#: 2360 posted 4:35 pm on Dec 20, 2004 (gmt 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.

infernofiasco

10+ Year Member



 
Msg#: 2360 posted 4:40 pm on Dec 20, 2004 (gmt 0)

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

How would i go about making the paths relevant?

infernofiasco

10+ Year Member



 
Msg#: 2360 posted 4:41 pm on Dec 20, 2004 (gmt 0)

sorry i meant relative :)

txbakers

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



 
Msg#: 2360 posted 4:42 pm on Dec 20, 2004 (gmt 0)

maybe make two sets of images then? You need to make the https a self-contained unit.

infernofiasco

10+ Year Member



 
Msg#: 2360 posted 4:54 pm on Dec 20, 2004 (gmt 0)

We are talkin about 1000s of packshots, which due to capacity couldnt be doubled. Is there an easy approach to relative paths?

dotme

10+ Year Member



 
Msg#: 2360 posted 9:38 pm on Dec 20, 2004 (gmt 0)

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

Is it all physically on one machine?

tomasz

10+ Year Member



 
Msg#: 2360 posted 10:30 pm on Dec 20, 2004 (gmt 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

infernofiasco

10+ Year Member



 
Msg#: 2360 posted 9:02 am on Dec 21, 2004 (gmt 0)

Yes the images / site are on one physical machine!

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

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved