<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
> <channel><title>David Pratt &#187; security</title> <atom:link href="http://daipratt.co.uk/tag/security/feed/" rel="self" type="application/rss+xml" /><link>http://daipratt.co.uk</link> <description>Concerned about Website Construction &#38; SEO</description> <lastBuildDate>Wed, 25 Jan 2012 07:16:58 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.1.4</generator> <item><title>&#8220;This Page Contains Both Secure and Non-Secure Items&#8221;</title><link>http://daipratt.co.uk/this-page-contains-both-secure-and-non-secure-items/</link> <comments>http://daipratt.co.uk/this-page-contains-both-secure-and-non-secure-items/#comments</comments> <pubDate>Tue, 24 Nov 2009 08:14:12 +0000</pubDate> <dc:creator>David Pratt</dc:creator> <category><![CDATA[Tech]]></category> <category><![CDATA[debugging]]></category> <category><![CDATA[html]]></category> <category><![CDATA[security]]></category> <guid
isPermaLink="false">http://daipratt.co.uk/?p=665</guid> <description><![CDATA[When you get this message on a webpage, you might be needing a protocol-independent absolute path that switches between HTTP and HTTPS.]]></description> <content:encoded><![CDATA[<p>If you are familiar with the message above, then you have probably seen it a hundred times before.</p><div
id="attachment_666" class="wp-caption alignnone" style="width: 342px"><img
src="http://daipratt.co.uk/wp-content/uploads/2009/11/nonsecure-popup.png" alt="This Page Contains Both Secure and Non-Secure Items" title="Most common popup on the web!" width="332" height="158" class="size-full wp-image-666" /><p
class="wp-caption-text">This Page Contains Both Secure and Non-Secure Items</p></div><p>Or</p><div
id="attachment_701" class="wp-caption alignnone" style="width: 493px"><img
src="http://daipratt.co.uk/wp-content/uploads/2009/11/security.png" alt="Do you want to view only the webpage content that was delivered securely" title="security" width="483" height="193" class="size-full wp-image-701" /><p
class="wp-caption-text">Do you want to view only the webpage content that was delivered securely</p></div><p>It is caused (as I&#8217;m sure you can figure out from the title) by having non-secure items on a secure page i.e. having an asset that sits on the HTTP protocol being called from a secure HTTPS page.  This often occurs on checkout confirmation pages, or sign up thank you pages where a developer has a included an absolute path to something that sits on the HTTP protocol.  In my experience this is very often 3rd party tracking pixels or marketing banners that have been added as an afterthought.</p><p>There is a very straightforward solution to this problem however, all you need to do is use a protocol-independent absolute path that switches between HTTP and HTTPS depending on what protocol the asset is currently sat on. To do this you need to modify (in the case of images) the src path so that it looks something like:</p><pre class="brush: php">
&lt;img src="//daipratt.co.uk/i/tracking.png"/&gt;
</pre><p>All I have done here is drop the &#8220;http:&#8221; from the url, leaving the &#8220;//&#8221; behind.  If you are looking at a page in SSL through HTTPS, then what it will do is request that asset with the HTTPS protocol, otherwise it&#8217;ll request it with HTTP.  This then prevents the annoying error message as all of the page assets are sat on the same protocol.</p> ]]></content:encoded> <wfw:commentRss>http://daipratt.co.uk/this-page-contains-both-secure-and-non-secure-items/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> </channel> </rss>
