<?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>nPath Ltd. &#187; HTTPS</title>
	<atom:link href="http://www.npathweb.com/tag/https/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.npathweb.com</link>
	<description>Web Development Blog</description>
	<lastBuildDate>Mon, 22 Feb 2010 15:16:30 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>switch to ssl automatically</title>
		<link>http://www.npathweb.com/2009/02/05/switch-to-ssl-automatically/</link>
		<comments>http://www.npathweb.com/2009/02/05/switch-to-ssl-automatically/#comments</comments>
		<pubDate>Thu, 05 Feb 2009 17:04:06 +0000</pubDate>
		<dc:creator>B.Harding</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[ASP.net]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[HTTPS]]></category>
		<category><![CDATA[SSL]]></category>
		<category><![CDATA[VB.Net]]></category>

		<guid isPermaLink="false">http://www.npathweb.com/blog/?p=21</guid>
		<description><![CDATA[In this post I&#8217;ll explain how I transparently switch from http to https
This same snipit can be put on any page as is and forces certain pages to be https. The nice thing about it is that the user can not edit the url back to http on a page that has this. All I [...]]]></description>
			<content:encoded><![CDATA[<p>In this post I&#8217;ll explain how I transparently switch from http to https</p>
<p>This same snipit can be put on any page as is and forces certain pages to be https. The nice thing about it is that the user can not edit the url back to http on a page that has this. All I did was put it on the login page and payment page.</p>
<p>On page load the server examines the Request.IsSecureConnection flag and redirects if not secure. It&#8217;s that simple. To make it a re-useble snipit I get the page name dynamically.</p>
<p>Be sure not to include the slash after your top level domain.</p>
<p><span style="font-size: x-small;"> </span></p>
<p><span style="color: #0000ff; font-size: x-small;">If</span><span style="font-size: x-small;"> </span><span style="color: #0000ff; font-size: x-small;">Not</span><span style="font-size: x-small;"> Page.IsPostBack </span><span style="color: #0000ff; font-size: x-small;">Then</span></p>
<p><span style="font-size: x-small;"> </span></p>
<p><span style="color: #0000ff; font-size: x-small;"> If</span><span style="font-size: x-small;"> </span><span style="color: #0000ff; font-size: x-small;">Not</span><span style="font-size: x-small;"> Request.IsSecureConnection </span><span style="color: #0000ff; font-size: x-small;">Then</span></p>
<p><span style="font-size: x-small;"> </span></p>
<p><span style="font-size: x-small;"> Response.Redirect(</span><span style="color: #800000; font-size: x-small;">&#8220;https://www.yourhostname.com&#8221;</span><span style="font-size: x-small;"> &amp; Request.Url.PathAndQuery.ToString)</span></p>
<p><span style="color: #0000ff; font-size: x-small;"> End</span><span style="font-size: x-small;"> </span><span style="color: #0000ff; font-size: x-small;">If</span></p>
<p><span style="font-size: x-small;"> </span></p>
<p><span style="color: #0000ff; font-size: x-small;">End</span><span style="font-size: x-small;"> </span><span style="color: #0000ff; font-size: x-small;">If</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.npathweb.com/2009/02/05/switch-to-ssl-automatically/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
