views:

928

answers:

5

In IE7 my web site always causes the browser to prompt a "Security Information" dialogue box:

This page contains both secure and non-secure items.

Do you want to display the non-secure items?

How can I avoid getting this message when traveling between non-secure and secure pages (HTTP to HTTPS)?

+13  A: 

You need to make sure all your images, script files, CSS files and so on have HTTPS urls if you're on a secure page.

If you view-source and search for "http:" this will soon tell which one (or more) is wrong.

Example:

<script src="script.js" type="text/javascript"></script> - Correct
<script src="https://ssl.google.com/ga.js" type="text/javascript"></script> - Correct
<script src="http://www.google.com/ga.js" type="text/javascript"></script> - Wrong
Greg
Thanks RoBorg you are correct! I located these miscreants in my Flash detection script: "codebase", "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0","pluginspage", "http://www.adobe.com/go/getflashplayer"Luckily, Adobe redirects the HTTPS links to HTTP.
GOOT
+1  A: 

You should make sure that you haven't included http:// explicitly anywhere in your code. If you did then that message will be displayed.

Mykroft
A: 

There is also an option in IE to toggle this message when moving from HTTP to HTTPS pages. In IE7, it's on the advanced tab, second checkbox from the bottom.

There is also a 'Display mixed content' option in IE7, security tab, custom level.
Set it to Enabled for the site level you're accessing the site as.

Bravax
You cant ask all the website users to do this :)
Shoban
Of course not, but as far as i'm aware that's the only way to remove that message when browsing from a non-secure to a secure webpage.To remove it from one particular webpage, use RoBorg's answer.
Bravax
+3  A: 

RoBorg has it dead on. However, it can be tricky sometimes to track down the specific page or item causing the problem. Often it is a broken link that redirects to the "404-page not found" page.

A trick I like to use is to hit the page and answer in the affirmative on the prompt then look at the IIS log entries generated for any rows with an 80 in the port column instead of 443.

JohnFx
A: 

Lord how I hate IE...if only we could all invocie M$ direct for the amount of time BURNED trying to keep not only their browser happy and (silent) but client happy, and, ultiamtely, silent also.

May FireFox reign hell down apon thee.

Georonimo
AAAAAAAAAAAAAAMEN!
salmane

related questions