Published on .MVC Madness (http://www.mvcmadness.com)
Quick Fix Secure and Non Secure Items on Page

By: Brennan Heyde Published On: 11/13/2007

One problem I've seen a lot recently is when a website gives you the “This page contains both secure and non-secure items…” warning.

This is caused when you enter a secure page on a website, one that is protected by an SSL, and the page contains images or other external elements which have an absolute URL. You can tell whether or not you are on a secure page by looking at the URL. If it says "https://www" – notice the “s” in front of the http, then it means you are on a secure page.

When you enter a secure page all the external images, JavaScript, and tracking code, must use a relative URL in the "src" field. If any of those items use a absolute URL (a URL starting with http://)
then you will get the error, “This page contains both secure and non-secure items…”

Most likely it is one of the following items causing the error.

  1. An Image with the full URL as the source
  2. An external JavaScript file, with the full URL as the source
  3. Tracking Code (such as Google Analytics) which uses http:// instead of https://
  4. A CSS file which contains an absolute URL to an image.

Most likely though the error is going to be caused by an image. Here is a quick fix
Go to the webpage where you are seeing the error. Right click and view the source code.

Then do a find, and look for src="http:// This will show you any image or external file which uses a full URL as the source.

One you find out all your images which have the full URL in the source, go through and change them to a relative URL.

Here is an example:

Change this:
<img src=“http://www.youtsite.com/graphics/00000001/myimage.jpg”>

To this:
<img src=“/graphics/00000001/myimage.jpg”>

That’s all there is to it. Once you get rid of all of the absolute URL’s in the “src” field, that pesky little error will disappear.

About the Author: Brennan Heyde is an e-commerce consultant working in San Diego, Ca. He specializes in online marketing and SEO for e-commerce.  Have a struggling e-commerce website? – Contact Brennan today for a site analysis.


Source URL: http://www.mvcmadness.com/content/quick-fix-secure-and-non-secure-items-page