<?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>Bohack &#187; Redirection</title>
	<atom:link href="http://www.bohack.com/tag/redirection/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bohack.com</link>
	<description>Check In and Tune Out!</description>
	<lastBuildDate>Wed, 25 Aug 2010 00:44:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>Redirect HTTP to SSL with IIS</title>
		<link>http://www.bohack.com/2008/12/redirect-http-to-ssl-with-iis/</link>
		<comments>http://www.bohack.com/2008/12/redirect-http-to-ssl-with-iis/#comments</comments>
		<pubDate>Sun, 07 Dec 2008 17:58:09 +0000</pubDate>
		<dc:creator>Bohack</dc:creator>
				<category><![CDATA[Windows]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[Redirection]]></category>

		<guid isPermaLink="false">http://www.bohack.com/?p=141</guid>
		<description><![CDATA[It has become culture to prepend the http:// prefix in front of a URL. In fact if you type the URL in most web browsers and hit ctrl-enter, the browser will prepend the http:// in front of the URL. The HTTP (Hypertext Transfer Protocol) works on port 80 TCP and is defined in RFC 2616. [...]]]></description>
			<content:encoded><![CDATA[<p>It has become culture to prepend the http:// prefix in front of a URL. In fact if you type the URL in most web browsers and hit ctrl-enter, the browser will prepend the http:// in front of the URL. The HTTP (Hypertext Transfer Protocol) works on port 80 TCP and is defined in RFC 2616. Since HTTP language is clear text over port 80 TCP that means that forms authentication will travel over clear text and can be intercepted. So it is recommended that HTTPS (Hypertext Transfer Protocol over Secure Socket Layer) be used to encrypt the session with SSL. HTTPS or SSL works over port 443 TCP and requires a private certificate be installed from a browser trusted Certificate Authority (out of the scope of this article).</p>
<p><span id="more-141"></span> When you install Microsoft IIS, it defaults the first web site called &#8220;Default Web Site&#8221; to Port 80 and listens for HTTP requests on all assigned IPs. Sometime we need to install an application that requires SSL or we have chosen to require all communications be encrypted with SSL for the web application. IIS can be told to &#8220;Require Secure Channel (SSL)&#8221; and refuse all HTTP or non-SSL traffic; however it is culture to prepend the HTTP. So a redirection is needed from the HTTP request to an HTTPS request or Port 80 TCP to Port 443 TCP.</p>
<p>In my example, the server I installed uses a self-signed cert that was generated using the IIS Resource Kit 6 tool SelfSSL. On your site you may choose to use a public CA or internal CA trusted by your browser. So the first step is to install your application and install a Certificate through the &#8220;Directory Security&#8221; tab of the web site&#8217;s properties. On the Directory Security tab find the section titled &#8220;Secure Communications&#8221; and click &#8220;Edit&#8221;; you will then see the &#8220;Require Secure Channel (SSL)&#8221; option (see figure below).</p>
<a href="http://www.bohack.com/wp-content/uploads/2008/12/secure-communications-properties.jpg"  rel="lightbox[141]"  class="lightbox"><img src="http://www.bohack.com/wp-content/uploads/photojar/cache/secure-communications-properties-300x300-0-img143.jpg" alt="IIS Secure Communications Dialog Box" title="secure-communications-properties" width="300" height="283" class="alignnone size-medium wp-image-143" /></a>
<p>Once this is selected the site will return &#8220;HTTP Error 403.4 &#8211; Forbidden: SSL is required to view this resource. Internet Information Services (IIS)&#8221;, if clear text is used; not the most friendly error for your users.</p>
<a href="http://www.bohack.com/wp-content/uploads/2008/12/403-error.jpg"  rel="lightbox[141]"  class="lightbox"><img src="http://www.bohack.com/wp-content/uploads/photojar/cache/403-error-300x300-0-img145.jpg" alt="HTTP Error 403.4 - Forbidden: SSL is required to view this resource." title="403.4-error" width="279" height="300" class="alignnone size-medium wp-image-145" /></a>
<p>To solve this simple problem we will create a new web site that listens only for HTTP on port 80 TCP and redirects to the URL via HTTPS on port 443 TCP. You will need to re-assign an unused port number to the SSL site and you still need a directory to point the new site to.</p>
<p>Step 1 &#8211; Right click on your original site and click &#8220;Properties&#8221; then click on the &#8220;Web Site Tab&#8221;. Change the &#8220;TCP Port&#8221; under &#8220;Web Site Identification&#8221; to an unused port like 8080.</p>
<a href="http://www.bohack.com/wp-content/uploads/2008/12/web-site-identification.jpg"  rel="lightbox[141]"  class="lightbox"><img src="http://www.bohack.com/wp-content/uploads/photojar/cache/web-site-identification-300x300-0-img150.jpg" alt="Web Site Identification Dialog Box" title="web-site-identification" width="300" height="282" class="alignnone size-medium wp-image-150" /></a>
<p>Step 2 &#8211; Create a &#8220;redirection&#8221; file folder under c:\inetpub or your root web files. I usually create a file that describes not to ever delete the folder. You need to create this folder, because your redirection site needs to point to a folder even if it is not going to use it.</p>
<a href="http://www.bohack.com/wp-content/uploads/2008/12/placeholder-directory.jpg"  rel="lightbox[141]"  class="lightbox"><img src="http://www.bohack.com/wp-content/uploads/photojar/cache/placeholder-directory-300x300-0-img151.jpg" alt="Redirection Website Place Holder Directory" title="placeholder-directory" width="300" height="213" class="alignnone size-medium wp-image-151" /></a>
<p>Step 3 &#8211; Create the &#8220;Redirection&#8221; Web Site by right clicking &#8220;Web Sites&#8221; in the MMC and selecting &#8220;New&#8221; then &#8220;Web Site&#8221; from the context menu. Follow the wizard and name it &#8220;Redirection&#8221; and point it to the directory created in Step 2; assume all defaults.</p>
<a href="http://www.bohack.com/wp-content/uploads/2008/12/redirection-web-site.jpg"  rel="lightbox[141]"  class="lightbox"><img src="http://www.bohack.com/wp-content/uploads/2008/12/redirection-web-site.jpg" alt="Redirection Web Site" title="redirection-web-site" width="300" height="300" class="alignnone size-medium wp-image-152" /></a>
<p>StepÂ  4 &#8211; Right click the web site created in Step 3 and select &#8220;Properties&#8221; from the context menu, then select the &#8220;Home Directory&#8221; tab. From this tab you will click on &#8220;A Redirection to a URL&#8221; then type in your redirection URL of HTTPS://www.bohack.com.</p>
<a href="http://www.bohack.com/wp-content/uploads/2008/12/home-directory-redirection.jpg"  rel="lightbox[141]"  class="lightbox"><img src="http://www.bohack.com/wp-content/uploads/photojar/cache/home-directory-redirection-300x300-0-img153.jpg" alt="Home Directory Dialog Box" title="home-directory-redirection" width="294" height="300" class="alignnone size-medium wp-image-153" /></a>
]]></content:encoded>
			<wfw:commentRss>http://www.bohack.com/2008/12/redirect-http-to-ssl-with-iis/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
