Question

I have a web application (.NET 2.0 coded in C#) that displays pages both to logged in users and the general public. When a user logs in, the protocol is switched to HTTPS. The images are being displayed by a CSS file residing in a virtual directory folder. The problem is that when the HTTPS pages are displayed, IE 8 will display a message saying that there is mixed security content on the page. I dont want the user to disable mixed content on their browser, rather, what the web application to furnish the images via HTTPS if the member is logged in.

If the images were in the HTML file, then it would be easy to pass in the server variable specifying the protocol (HTTP or HTTPS) to the HTML page. However, how do I pass a server variable to CSS specifying the protocol? All the path in the CSS file are relative.

e.g. body { font: 12px Arial, Helvetica, sans-serif; color: #000000; background: #eadcc8 url(../images/bg_top.gif) no-repeat 0 0; text-align: center; margin: 0px; }

I am not too familiar with CSS functionality, apart from colors and styles.

Thanks for your help in advance.

Was it helpful?

Solution

There has to be an absolute path somewhere. Visit the https page, look at its source and search for "http:" in it. If that doesn't work, look for it in the files it embeds.

Edit: If that doesn't work for you or you think of it as being too complicated, you can also use Google Chromes Developer Tools (Tab "Resources") to monitor all http requests.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top