<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.iis.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:cs="http://blogs.iis.net/"><channel><title>Redirecting from http to https in IIS7</title><link>http://blogs.iis.net/sukesh/archive/2006/09/03/http2https.aspx</link><description>I was thinking to write an HttpModule for IIS7 and wanted a simple, useful and easily understandable scenario. Working with IIS customers for last 3 years one of those common scenario came into my mind, Redirecting http traffic to https. Although this</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>re: Redirecting from http to https in IIS7</title><link>http://blogs.iis.net/sukesh/archive/2006/09/03/http2https.aspx#3452053</link><pubDate>Sun, 11 Oct 2009 02:35:08 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:3452053</guid><dc:creator>sukesh</dc:creator><description>&lt;p&gt;This was a sample code to show how easy it is to do a redirection as IIS7 custom module.&lt;/p&gt;
&lt;p&gt;Since now you have url rewrite component available, I would suggest to go that route.&lt;/p&gt;
&lt;p&gt;A sample rule is given here...&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://www.iis-aid.com/articles/how_to_guides/redirect_http_to_https_iis_7"&gt;www.iis-aid.com/.../redirect_http_to_https_iis_7&lt;/a&gt;&lt;/p&gt;
&lt;img src="http://blogs.iis.net/aggbug.aspx?PostID=3452053" width="1" height="1"&gt;</description></item><item><title>re: Redirecting from http to https in IIS7</title><link>http://blogs.iis.net/sukesh/archive/2006/09/03/http2https.aspx#2429036</link><pubDate>Tue, 17 Jun 2008 17:57:14 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:2429036</guid><dc:creator>Leshchinsky</dc:creator><description>&lt;p&gt;Hi, I have the same problem. I'm using IIS 6.0. After moving from HTTP to HTTPs session have been dropped. Help me to resolve this problem. Thanks in advance.&lt;/p&gt;
&lt;p&gt;Vladimir&lt;/p&gt;
&lt;img src="http://blogs.iis.net/aggbug.aspx?PostID=2429036" width="1" height="1"&gt;</description></item><item><title>re: Redirecting from http to https in IIS7</title><link>http://blogs.iis.net/sukesh/archive/2006/09/03/http2https.aspx#2211549</link><pubDate>Tue, 04 Mar 2008 18:09:27 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:2211549</guid><dc:creator>Ian Hudson</dc:creator><description>&lt;p&gt;I agree with you Sukesh, it&amp;#39;s not common for customer to type in &lt;a href="http://domain:443/" target="_new" rel="nofollow"&gt;http://domain:443&lt;/a&gt; I think it would be easier actually to tell customers to just type in &lt;a href="https://domain%20or/" target="_new" rel="nofollow"&gt;https://domain or&lt;/a&gt; &lt;a href="https://subdomain.domain/" target="_new" rel="nofollow"&gt;https://subdomain.domain&lt;/a&gt; then adding the 443 port to the end there. &amp;nbsp;But it&amp;#39;s a good start. &amp;nbsp;&lt;/p&gt;&lt;img src="http://blogs.iis.net/aggbug.aspx?PostID=2211549" width="1" height="1"&gt;</description></item><item><title>re: Redirecting from http to https in IIS7</title><link>http://blogs.iis.net/sukesh/archive/2006/09/03/http2https.aspx#1423365</link><pubDate>Tue, 10 Oct 2006 05:12:15 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1423365</guid><dc:creator>sukesh</dc:creator><description>&lt;p&gt;Colin,&lt;/p&gt;
&lt;p&gt;Your implementation of SSL checking looks fool proof.&lt;/p&gt;
&lt;p&gt;But just another point, although 443 is a well defined port, you can host non-SSL site on 443 as well. So your mention of both url to be same is true in an ideal world only.&lt;/p&gt;
&lt;p&gt;Just FYI, from 3500+ customer I have worked with (in last 3yrs), haven't seen anyone using &lt;a rel="nofollow" target="_new" href="http://domain:443"&gt;http://domain:443&lt;/a&gt; for ssl. Secondly I also wanted to make my sample simple to understand.&lt;/p&gt;
&lt;p&gt;Thanks for your comment!&lt;/p&gt;
&lt;img src="http://blogs.iis.net/aggbug.aspx?PostID=1423365" width="1" height="1"&gt;</description></item><item><title>re: Redirecting from http to https in IIS7</title><link>http://blogs.iis.net/sukesh/archive/2006/09/03/http2https.aspx#1388317</link><pubDate>Sun, 03 Sep 2006 18:44:58 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1388317</guid><dc:creator>colinbo</dc:creator><description>&lt;p&gt;Perhaps this is just picky but I've found that relying on the URL isn't always accurate. &amp;nbsp;For example, I've (rarely) seen some people do &lt;a rel="nofollow" target="_new" href="http://domain.com:443"&gt;http://domain.com:443&lt;/a&gt; which is the same as &lt;a rel="nofollow" target="_new" href="https://domain.com"&gt;https://domain.com&lt;/a&gt;. &amp;nbsp;I've opted for the following server variable in the past. &amp;nbsp;Is this variable emitted by IIS7?&lt;/p&gt;
&lt;p&gt;private static bool IsRequestSecure(HttpRequest request)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;if ((String.Compare(request.ServerVariables[&amp;quot;HTTPS&amp;quot;], &amp;quot;on&amp;quot;, true, CultureInfo.InvariantCulture) == 0) |&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(request.IsSecureConnection))&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return true;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;else&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return false;&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;img src="http://blogs.iis.net/aggbug.aspx?PostID=1388317" width="1" height="1"&gt;</description></item></channel></rss>