<?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>Sukesh&amp;#39;s IIS Blog : HTTP &amp;amp; IIS</title><link>http://blogs.iis.net/sukesh/archive/tags/HTTP+_2600_amp_3B00_+IIS/default.aspx</link><description>Tags: HTTP &amp;amp; IIS</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Redirecting from http to https in IIS7 (http2https Updated)</title><link>http://blogs.iis.net/sukesh/archive/2007/09/05/redirecting-from-http-to-https-in-iis7-http2https-updated.aspx</link><pubDate>Wed, 05 Sep 2007 07:07:00 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:2241599</guid><dc:creator>sukesh</dc:creator><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.iis.net/sukesh/rsscomments.aspx?PostID=2241599</wfw:commentRss><comments>http://blogs.iis.net/sukesh/archive/2007/09/05/redirecting-from-http-to-https-in-iis7-http2https-updated.aspx#comments</comments><description>&lt;P&gt;I had written a sample to redirect all http traffic to https (secure) in September 2006 &lt;A href="http://www.awesomeideas.net/post/2006/09/03/Redirecting-from-http-to-https-in-IIS7.aspx"&gt;http://www.awesomeideas.net/post/2006/09/03/Redirecting-from-http-to-https-in-IIS7.aspx&lt;/A&gt; 
&lt;P&gt;In one of our internal discussion alias the question came up that this method does not work when SSL is forced on the website. Step 5 below handles that scenario by checking the "403.4 SSL required" response and handling it during OnEndRequest event. 
&lt;P&gt;&lt;STRONG&gt;So let us get into action (I'm using C# for this sample)&lt;/STRONG&gt; 
&lt;OL&gt;
&lt;LI&gt;Download and Install &lt;A class="" href="http://www.iis.net/downloads/default.aspx?tabid=34&amp;amp;g=6&amp;amp;i=1302" mce_href="http://www.iis.net/downloads/default.aspx?tabid=34&amp;amp;g=6&amp;amp;i=1302"&gt;IIS7 Managed Module Starter Kit&lt;/A&gt;&lt;BR&gt;(Not really a requirement but it would make developing IIS7 modules easier) 
&lt;LI&gt;Rename the default class name created to "redir.cs" and rename project/solution/namespace to "http2https" 
&lt;LI&gt;Add the following code in "Init" method &lt;BR&gt;
&lt;DIV&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt;// register for the BeginRequest event&lt;/SPAN&gt;
application.BeginRequest += &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; EventHandler(OnBeginRequest); 
application.EndRequest += &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; EventHandler(OnEndRequest);&lt;/PRE&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;LI&gt;Add the following method to implement "BeginRequest" event &lt;BR&gt;
&lt;DIV&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt;//BeginRequest implementation&lt;/SPAN&gt;
&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;void&lt;/SPAN&gt; OnBeginRequest(Object sender, EventArgs e)
{
HttpApplication app = (HttpApplication)sender;
&lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; HttpUrl = app.Request.Url.ToString(); 

   &lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; (HttpUrl.StartsWith(&lt;SPAN style="COLOR: #006080"&gt;"http:"&lt;/SPAN&gt;))                           &lt;SPAN style="COLOR: #008000"&gt;//Redirection done only if URL starts with http:&lt;/SPAN&gt;
   {
   HttpUrl = HttpUrl.Replace(&lt;SPAN style="COLOR: #006080"&gt;"http:"&lt;/SPAN&gt;, &lt;SPAN style="COLOR: #006080"&gt;"https:"&lt;/SPAN&gt;);
   app.Response.Redirect(HttpUrl.ToString(), &lt;SPAN style="COLOR: #0000ff"&gt;true&lt;/SPAN&gt;);           &lt;SPAN style="COLOR: #008000"&gt;//Redirecting (http 302) to the same URL but with https&lt;/SPAN&gt;
   app.Response.End();                                        &lt;SPAN style="COLOR: #008000"&gt;//We don't want to any further so end&lt;/SPAN&gt;
   }
} 
&lt;/PRE&gt;&lt;/DIV&gt;
&lt;LI&gt;
&lt;P&gt;Add the following method to implement "OnEndRequest" event&lt;BR&gt;&lt;/P&gt;
&lt;DIV&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&lt;SPAN style="COLOR: #008000"&gt;//This is for scenario where SSL is forced on the site&lt;/SPAN&gt;
&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;void&lt;/SPAN&gt; OnEndRequest(Object sender, EventArgs e)
{
  HttpApplication app = (HttpApplication)sender;
  &lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; (app.Response.StatusCode == 403 &amp;amp;&amp;amp; app.Response.SubStatusCode == 4)
  { 
    &lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt; HttpUrl = app.Request.Url.ToString();

    &lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt; (HttpUrl.StartsWith(&lt;SPAN style="COLOR: #006080"&gt;"http:"&lt;/SPAN&gt;))
    {
        HttpUrl = HttpUrl.Replace(&lt;SPAN style="COLOR: #006080"&gt;"http:"&lt;/SPAN&gt;, &lt;SPAN style="COLOR: #006080"&gt;"https:"&lt;/SPAN&gt;);
        app.Response.Redirect(HttpUrl.ToString(), &lt;SPAN style="COLOR: #0000ff"&gt;true&lt;/SPAN&gt;);
        app.Response.End();
    }
}

&lt;/PRE&gt;&lt;BR&gt;&lt;/DIV&gt;
&lt;LI&gt;Make sure you have the following in your web.config inside configuration tag &lt;BR&gt;
&lt;DIV&gt;&lt;PRE style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"&gt;&amp;lt;system.webServer&amp;gt;
&amp;lt;modules&amp;gt;
   &amp;lt;add name=&lt;SPAN style="COLOR: #006080"&gt;"redir"&lt;/SPAN&gt; type=&lt;SPAN style="COLOR: #006080"&gt;"http2https.redir"&lt;/SPAN&gt; /&amp;gt;
&amp;lt;/modules&amp;gt;
&amp;lt;/system.webServer&amp;gt; 
&lt;/PRE&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;&lt;BR&gt;&lt;/P&gt;
&lt;P&gt;Your http to https redirection sample is ready and also works if you force SSL!!! 
&lt;P&gt;&lt;STRONG&gt;&lt;BR&gt;How to deploy the HttpModule&lt;BR&gt;&lt;/STRONG&gt;There are multiple ways you can deploy this component (I'm assuming that it's being deployed for "default website") 
&lt;P&gt;&lt;U&gt;Method 1&lt;BR&gt;&lt;/U&gt;Create a folder called "App_Code" inside "%systemdrive%\inetpub\wwwroot"&lt;BR&gt;Copy "redir.cs" file into "App_Code" folder&lt;BR&gt;Copy "web.config" file inside "%systemdrive%\inetpub\wwwroot" 
&lt;P&gt;&lt;U&gt;Method 2&lt;BR&gt;&lt;/U&gt;Create a folder called "bin" inside "%systemdrive%\inetpub\wwwroot"&lt;BR&gt;Compile&amp;nbsp;"redir.cs" into "redir.dll" and copy&amp;nbsp;it into "bin" folder (to compile -&amp;gt; csc.exe /out:redir.dll /target:library redir.cs)&lt;BR&gt;Copy "web.config" file inside "%systemdrive%\inetpub\wwwroot" 
&lt;P&gt;If you open IIS7 UI and go to Modules you can see your HttpModule listed there.&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#ff0000&gt;&lt;STRONG&gt;Source code @ &lt;/STRONG&gt;&lt;A href="http://www.awesomeideas.net/page/IIS7-http2https.aspx"&gt;http://www.awesomeideas.net/page/IIS7-http2https.aspx&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.iis.net/aggbug.aspx?PostID=2241599" width="1" height="1"&gt;</description><category domain="http://blogs.iis.net/sukesh/archive/tags/IIS7/default.aspx">IIS7</category><category domain="http://blogs.iis.net/sukesh/archive/tags/HTTP+_2600_amp_3B00_+IIS/default.aspx">HTTP &amp;amp; IIS</category></item><item><title>Redirecting from http to https in IIS7</title><link>http://blogs.iis.net/sukesh/archive/2006/09/03/http2https.aspx</link><pubDate>Sun, 03 Sep 2006 18:22:00 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1388307</guid><dc:creator>sukesh</dc:creator><slash:comments>6</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.iis.net/sukesh/rsscomments.aspx?PostID=1388307</wfw:commentRss><comments>http://blogs.iis.net/sukesh/archive/2006/09/03/http2https.aspx#comments</comments><description>&lt;p&gt;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 is pretty straight forward requirement, till IIS6 it was difficult to achieve. Check the following KB 839357 (specifically for OWA scenario) which explains the cumbersome&amp;nbsp;steps .&lt;/p&gt;&lt;p&gt;(If you are looking for same functionality in prior versions of IIS, find it at the bottom of this post)&lt;/p&gt;&lt;p&gt;HttpModules are not something new if you are an ASP.NET developer. But there&amp;nbsp;are some differences. In IIS7 because of integrated pipeline, HttpModule applies to any request not just ASP.NET and that includes htm,jpg,asp,aspx,asmx,php,jsp...&lt;/p&gt;&lt;p&gt;&lt;strong&gt;So let us get into action (I&amp;#39;m using C# for this sample)&lt;/strong&gt;&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Download and Install &lt;a href="http://www.iis.net/handlers/871/ItemPermaLink.ashx" target="_blank"&gt;&lt;font color="#669966"&gt;IIS7 Managed Module Starter Kit&lt;/font&gt;&lt;/a&gt;&lt;br /&gt;(Not really a requirement but it would make developing IIS7 modules easier) &lt;/li&gt;&lt;li&gt;Rename the default class name created to &amp;quot;redir.cs&amp;quot; and rename project/solution/namespace to &amp;quot;http2https&amp;quot; &lt;/li&gt;&lt;li&gt;Add the following code in &amp;quot;&lt;font color="#0000ff"&gt;Init&lt;/font&gt;&amp;quot; method &lt;br /&gt;&lt;p&gt;&lt;font color="#008080"&gt;&lt;font color="#008000"&gt;// register for the BeginRequest event&lt;/font&gt;&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff"&gt;application.BeginRequest += new EventHandler(OnBeginRequest);&lt;/font&gt; &lt;/p&gt;&lt;/li&gt;&lt;li&gt;Add the following method to implement &amp;quot;BeginRequest&amp;quot; event &lt;br /&gt;&lt;p&gt;&lt;font color="#008000"&gt;//BeginRequest implementation&lt;/font&gt;&lt;br /&gt;&lt;font color="#0000ff"&gt;public void OnBeginRequest(Object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;HttpApplication app = (HttpApplication)sender;&lt;br /&gt;string HttpUrl = app.Request.Url.ToString(); &lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font color="#0000ff"&gt;if (HttpUrl.StartsWith(&amp;quot;http:&amp;quot;))&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color="#008000"&gt;//Redirection done only if URL starts with http:&lt;/font&gt;&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp; HttpUrl = HttpUrl.Replace(&amp;quot;http:&amp;quot;, &amp;quot;https:&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp; app.Response.Redirect(HttpUrl.ToString(), true);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color="#008000"&gt;//Redirecting (http 302) to the same URL but with https&lt;/font&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;app.Response.End();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#008000"&gt;//We don&amp;#39;t want to any further so end&lt;/font&gt;&lt;br /&gt;}&lt;br /&gt;}&lt;/font&gt; &lt;/p&gt;&lt;/li&gt;&lt;li&gt;Make sure you have the following in your web.config inside configuration tag&lt;br /&gt;&lt;font color="#0000ff"&gt;&amp;lt;system.webServer&amp;gt;&lt;br /&gt;&amp;lt;modules&amp;gt;&lt;br /&gt;&amp;lt;add name=&amp;quot;redir&amp;quot; type=&amp;quot;http2https.redir&amp;quot; /&amp;gt;&lt;br /&gt;&amp;lt;/modules&amp;gt;&lt;br /&gt;&amp;lt;/system.webServer&amp;gt;&lt;/font&gt; &lt;/li&gt;&lt;/ol&gt;&lt;p&gt;Your http to https redirection sample is ready!!!&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;br /&gt;How to deploy the HttpModule&lt;br /&gt;&lt;/strong&gt;There are multiple ways you can deploy this component (I&amp;#39;m assuming that it&amp;#39;s being deployed for &amp;quot;default website&amp;quot;)&lt;/p&gt;&lt;p&gt;&lt;u&gt;Method 1&lt;br /&gt;&lt;/u&gt;Create a folder called &amp;quot;&lt;font color="#0000ff"&gt;App_Code&lt;/font&gt;&amp;quot; inside &lt;font color="#0000ff"&gt;&amp;quot;%systemdrive%\inetpub\wwwroot&lt;/font&gt;&amp;quot;&lt;br /&gt;Copy &amp;quot;&lt;font color="#0000ff"&gt;redir.cs&lt;/font&gt;&amp;quot; file into &amp;quot;&lt;font color="#0000ff"&gt;App_Code&lt;/font&gt;&amp;quot; folder&lt;br /&gt;Copy &amp;quot;&lt;font color="#0000ff"&gt;web.config&lt;/font&gt;&amp;quot; file inside &lt;font color="#0000ff"&gt;&amp;quot;%systemdrive%\inetpub\wwwroot&lt;/font&gt;&amp;quot;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;u&gt;Method 2&lt;br /&gt;&lt;/u&gt;Create a folder called &amp;quot;&lt;font color="#0000ff"&gt;bin&lt;/font&gt;&amp;quot; inside &lt;font color="#0000ff"&gt;&amp;quot;%systemdrive%\inetpub\wwwroot&lt;/font&gt;&amp;quot;&lt;br /&gt;Compile&amp;nbsp;&amp;quot;&lt;font color="#0000ff"&gt;redir.cs&lt;/font&gt;&amp;quot; into &amp;quot;&lt;font color="#0000ff"&gt;redir.dll&lt;/font&gt;&amp;quot; and copy&amp;nbsp;it into &amp;quot;&lt;font color="#0000ff"&gt;bin&lt;/font&gt;&amp;quot; folder (to compile -&amp;gt; csc.exe /out:redir.dll /target:library redir.cs)&lt;br /&gt;Copy &amp;quot;&lt;font color="#0000ff"&gt;web.config&lt;/font&gt;&amp;quot; file inside &lt;font color="#0000ff"&gt;&amp;quot;%systemdrive%\inetpub\wwwroot&lt;/font&gt;&amp;quot;&lt;/p&gt;&lt;p&gt;If you open IIS7 UI and go to Modules you can see your HttpModule listed there.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;u&gt;Redirection options for prior versions of IIS below (you need to search for these)&lt;/u&gt;&lt;/p&gt;&lt;p&gt;- ASP.NET URL mapping capability (HttpContext.RewritePath)&lt;br /&gt;- IIS v6.0 Resource Kit includes the UrlRemap tool&lt;br /&gt;- IISRewrite &lt;br /&gt;- ISAPI_Rewrite - includes a &amp;quot;lite&amp;quot; version available for free. &lt;br /&gt;- Mod_Rewrite 2&lt;br /&gt;- Ionic&amp;#39;s ISAPI Rewrite Filter&lt;/p&gt;&lt;img src="http://blogs.iis.net/aggbug.aspx?PostID=1388307" width="1" height="1"&gt;</description><category domain="http://blogs.iis.net/sukesh/archive/tags/IIS7/default.aspx">IIS7</category><category domain="http://blogs.iis.net/sukesh/archive/tags/HTTP+_2600_amp_3B00_+IIS/default.aspx">HTTP &amp;amp; IIS</category></item><item><title>Back to Basics - HTTP/IIS (Part II)</title><link>http://blogs.iis.net/sukesh/archive/2006/05/16/httpbasics2.aspx</link><pubDate>Tue, 16 May 2006 21:17:00 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1304058</guid><dc:creator>sukesh</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.iis.net/sukesh/rsscomments.aspx?PostID=1304058</wfw:commentRss><comments>http://blogs.iis.net/sukesh/archive/2006/05/16/httpbasics2.aspx#comments</comments><description>&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;Let us see how HTTP is extended to do more than serving static content.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;When we talk about Windows Platform &amp;amp; HTTP, Microsoft product which comes to the picture is IIS. In the early days (and early versions of IIS) HTTP was primarily used for hosting websites and to enable people to use browsers to request those websites.&lt;span&gt;&amp;nbsp; &lt;/span&gt;So in essence IIS (or for that matter any web server) is built to serve &amp;ldquo;static&amp;rdquo; HTML pages with resources like images (referring to IIS2). But later versions of IIS provided ways to extend the web server in order to provide dynamically serving websites. In IIS world we call it as ISAPI Extensions. Hmmm... So what is ISAPI Filters then?&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;Let&amp;rsquo;s try to understand more about ISAPI Filters, ISAPI Extensions &amp;amp; Wildcard ISAPI Extensions to get more clarity.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;color:blue;font-family:Verdana;"&gt;ISAPI Filters&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;From the name itself you know that it&amp;rsquo;s something to do with filtering. Yea you got it right! So IIS exposes a set of notifications (IIS term for events) so that we can develop an ISAPI Filter (dll with a difference) to register for these notifications. When IIS triggers these notifications your ISAPI Filter DLL gets a chance to handle the data available for that specific notification. &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;Confused? Huh! Let me try with a hypothetical example then, &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;Assume that you have an ASP application and you don&amp;rsquo;t want your web users to know that it&amp;rsquo;s really ASP. So what can you do? Let them request .ASPX pages and we will change the extension to .ASP before IIS gets it for further processing. Good Idea?&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;Change all your links in the site to point to .ASPX extension. And when web users request &amp;ldquo;default.aspx&amp;rdquo; the ISAPI Filter would change the file requested to &amp;ldquo;default.asp&amp;rdquo; without the user&amp;rsquo;s knowledge and show off that you are running an ASP.NET application but under the hood it&amp;rsquo;s a legacy ASP application. &lt;/span&gt;&lt;span style="font-size:10pt;font-family:Wingdings;"&gt;&lt;span&gt;J&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;color:blue;font-family:Verdana;"&gt;How does this work or how is this implemented? &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;color:blue;font-family:Verdana;"&gt;&lt;/span&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;Like I mentioned before you need to use one of those ISAPI Filter notification called SF_NOTIFY_PREPROC (search on MSDN for more information). So what does that give us? When a request enters IIS and when IIS reads in the HTTP request header our ISAPI Filter gets a chance to access HTTP request header and if required we can modify it. So in our scenario, we would see that URL field in the header contains &amp;ldquo;default.aspx&amp;rdquo;. Yes you guessed it, we would change that URL to &amp;ldquo;default.asp&amp;rdquo; and let IIS know that it needs further processing. Cool deal hah!&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;Important piece of code from the ISAPI source provided below to show how easy it is&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;table cellpadding="0" cellspacing="0" class="MsoTableGrid" style="border-collapse:collapse;border:medium none;"&gt;&lt;tr&gt;&lt;td style="padding-right:5.4pt;padding-left:5.4pt;padding-bottom:0in;width:6.15in;padding-top:0in;background-color:transparent;border:windowtext 1pt solid;"&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;Char buffer[256];&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;DWORD buffSize = sizeof(buffer);&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;BOOL bHeader = pHeaderInfo-&amp;gt;GetHeader(pCtxt-&amp;gt;m_pFC,&amp;quot;url&amp;quot;,buffer,&amp;amp;buffSize); &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;CString urlString(buffer);&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;urlString.MakeLower(); &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;if (urlString.Find(&amp;quot;&lt;strong&gt;.aspx&lt;/strong&gt;&amp;rdquo;) != -1) //we want to change this file&amp;rsquo;s extension&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;urlString.Replace(&amp;quot;&lt;strong&gt;.aspx&lt;/strong&gt;&amp;quot;,&amp;quot;&lt;strong&gt;.asp&lt;/strong&gt;&amp;quot;);&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;char *newUrlString= urlString.GetBuffer(urlString.GetLength());&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;pHeaderInfo-&amp;gt;SetHeader(pCtxt-&amp;gt;m_pFC, &amp;quot;url&amp;quot;, newUrlString);&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;//we&amp;rsquo;re done, now give it to IIS for further processing&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;return SF_STATUS_REQ_HANDLED_NOTIFICATION; &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;color:blue;font-family:Verdana;"&gt;ISAPI Extensions&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;So like I mentioned before a web server serves static pages, the dynamic features like ASP, ASP.NET, PHP etc happens because of ISAPI extensions. So the obvious is that ISAPI Extensions are a way to extend the Web Server to add more features to it.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;So once the requests surpass the ISAPI Filter and if the request is not for static page, IIS searches for an ISAPI extension which is mapped to the request file extension. If found the request is forwarded to that ISAPI Extension for further processing and returning a valid response back to the client.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;color:blue;font-family:Verdana;"&gt;Wildcard ISAPI Extensions (IIS6 specific)&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;Here we will talk about why we need this piece and what are we trying to achieve here. Yes you guessed it, Wildcard extensions comes in between ISAPI Filters &amp;amp; ISAPI Extensions, so that it can have the features of both ISAPI Filters &amp;amp; Extensions.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;table cellpadding="0" cellspacing="0" class="MsoTableGrid" style="width:6.15in;border-collapse:collapse;border:medium none;"&gt;&lt;tr&gt;&lt;td style="padding-right:5.4pt;padding-left:5.4pt;padding-bottom:0in;width:51.4pt;padding-top:0in;background-color:transparent;border:windowtext 1pt solid;"&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;strong&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;Request&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="border-right:windowtext 1pt solid;padding-right:5.4pt;border-top:windowtext 1pt solid;padding-left:5.4pt;padding-bottom:0in;border-left:#ece9d8;width:332pt;padding-top:0in;border-bottom:windowtext 1pt solid;background-color:transparent;"&gt;&lt;p align="center" class="MsoNormal" style="margin:0in 0in 0pt;text-align:center;"&gt;&lt;strong&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;IIS&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt; [ ISAPI Filter -&amp;gt; Wildcard Extension -&amp;gt; ISAPI Extension]&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="border-right:windowtext 1pt solid;padding-right:5.4pt;border-top:windowtext 1pt solid;padding-left:5.4pt;padding-bottom:0in;border-left:#ece9d8;width:59.4pt;padding-top:0in;border-bottom:windowtext 1pt solid;background-color:transparent;"&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;strong&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;Response&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;Before getting into details lets see the Pros &amp;amp; Cons of ISAPI Filters &amp;amp; ISAPI Extensions.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;strong&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;ISAPI Filters&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;color:blue;font-family:Verdana;"&gt;Pros of ISAPI Filters&lt;/span&gt;&lt;/p&gt;&lt;ol style="margin-top:0in;"&gt;&lt;li class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;tab-stops:list .5in;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;Every request can be intercepted regardless of the file extension&lt;/span&gt; &lt;/li&gt;&lt;li class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;tab-stops:list .5in;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;Filter notification allows us to enhance or replace some of the IIS features&lt;/span&gt; &lt;ol style="margin-top:0in;"&gt;&lt;li class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;tab-stops:list 1.0in;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;Custom Redirection or request filtering&amp;nbsp;- &lt;/span&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;SF_NOTIFY_PREPROC_HEADERS&lt;/span&gt; &lt;/li&gt;&lt;li class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;tab-stops:list 1.0in;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;Custom Authentication &amp;ndash; SF_NOTIFY_AUTHENTICATION&lt;/span&gt; &lt;/li&gt;&lt;li class="MsoNormal" style="margin:0in 0in 0pt;tab-stops:list 1.0in;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;Modify IIS log values &amp;ndash; SF_NOTIFY_LOG&lt;br /&gt;etc&amp;hellip; (notification list documented on MSDN)&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;color:blue;font-family:Verdana;"&gt;Cons of ISAPI Filters&lt;/span&gt;&lt;/p&gt;&lt;ol style="margin-top:0in;"&gt;&lt;li class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;tab-stops:list .5in;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;No Asynchronous support&lt;/span&gt; &lt;/li&gt;&lt;li class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;tab-stops:list .5in;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;Uses IIS thread pool and cannot implement its own thread pool, so whatever processing of request is being done inside the filter should be completed quickly, otherwise chances are that IIS runs out of worker threads and users starts seeing errors like &amp;ldquo;Server too busy&amp;rdquo; or IIS gets into a hung state without responding to requests.&lt;/span&gt; &lt;/li&gt;&lt;li class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;tab-stops:list .5in;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;No access to entity body (huh! its another term for HTTP request body)&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;strong&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;ISAPI Extensions&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;color:blue;font-family:Verdana;"&gt;Pros of ISAPI Extensions&lt;/span&gt;&lt;/p&gt;&lt;ol style="margin-top:0in;"&gt;&lt;li class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;tab-stops:list .5in;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;Gets the entire entity body (HTTP request body)&lt;/span&gt; &lt;/li&gt;&lt;li class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;tab-stops:list .5in;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;Can implement custom thread pool&lt;/span&gt; &lt;/li&gt;&lt;li class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;tab-stops:list .5in;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;Processing the request can be asynchronous&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;color:blue;font-family:Verdana;"&gt;Cons of ISAPI Extensions&lt;/span&gt;&lt;/p&gt;&lt;ol style="margin-top:0in;"&gt;&lt;li class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;tab-stops:list .5in;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;Can handle only requests to specific extensions (because its mapped to specific file extension.&lt;/span&gt; &lt;/li&gt;&lt;li class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;tab-stops:list .5in;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;Processing happens only after getting the complete request entity body.&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;strong&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;Wildcard ISAPI Extensions&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;color:blue;font-family:Verdana;"&gt;Pros of ISAPI Wildcard Extensions (hybrid of Filter &amp;amp; Extension)&lt;/span&gt;&lt;/p&gt;&lt;ol style="margin-top:0in;"&gt;&lt;li class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;tab-stops:list .5in;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;Every request can be intercepted regardless of the file extension&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt 0.75in;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;ISAPI Filters: Yes&lt;br /&gt;ISAPI Extensions: No&lt;/span&gt;&lt;/p&gt;&lt;ol style="margin-top:0in;"&gt;&lt;li class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;tab-stops:list .5in;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;Implement custom thread pool&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt 0.75in;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;ISAPI Filters: No&lt;br /&gt;ISAPI Extensions: Yes&lt;/span&gt;&lt;/p&gt;&lt;ol style="margin-top:0in;"&gt;&lt;li class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;tab-stops:list .5in;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;Asynchronous Processing&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt 0.75in;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;ISAPI Filters: No&lt;br /&gt;ISAPI Extensions: Yes&lt;/span&gt;&lt;/p&gt;&lt;ol style="margin-top:0in;"&gt;&lt;li class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;tab-stops:list .5in;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;Handle entire request processing and return response to the client or hand over to an ISAPI Extension (according to the extension) for further processing.&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt 0.75in;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;ISAPI Filters: Yes&lt;br /&gt;ISAPI Extensions: Yes&lt;/span&gt;&lt;/p&gt;&lt;ol style="margin-top:0in;"&gt;&lt;li class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;tab-stops:list .5in;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;Can get access to complete request entity body&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt 0.75in;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;ISAPI Filters: No&lt;br /&gt;ISAPI Extensions: Yes&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt 0.75in;text-align:justify;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;So from the above list you can see that Wildcard ISAPI Extension provides a way to get best of both worlds (ISAPI Filter &amp;amp; ISAPI Extension).&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin:0in 0in 0pt;text-align:justify;"&gt;&lt;span style="font-size:10pt;font-family:Verdana;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;img src="http://blogs.iis.net/aggbug.aspx?PostID=1304058" width="1" height="1"&gt;</description><category domain="http://blogs.iis.net/sukesh/archive/tags/HTTP+_2600_amp_3B00_+IIS/default.aspx">HTTP &amp;amp; IIS</category></item><item><title>Back to Basics - HTTP (Part I)</title><link>http://blogs.iis.net/sukesh/archive/2006/05/06/httpbasics.aspx</link><pubDate>Sat, 06 May 2006 21:15:00 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1304056</guid><dc:creator>sukesh</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.iis.net/sukesh/rsscomments.aspx?PostID=1304056</wfw:commentRss><comments>http://blogs.iis.net/sukesh/archive/2006/05/06/httpbasics.aspx#comments</comments><description>&lt;P class=MsoNormal align=center&gt;&lt;SPAN&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;Most of my interactions in the past with customers, web developers and some of my prior colleagues, I have found that a larger percentage of them don't have a good understanding of how HTTP protocol works. This could be due to various reasons; some of them could be like&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI class=MsoNormal&gt;&lt;SPAN&gt;Coming from windows application development background.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt; 
&lt;LI class=MsoNormal&gt;&lt;SPAN&gt;Not getting enough time to go through the details due to project deadlines. &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;
&lt;LI class=MsoNormal&gt;&lt;SPAN&gt;Too difficult to get the meat out of HTTP RFC document because it’s too much to read.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;This results in lot of confusions and also leads to low performance application development. So I thought I would help the readers of putting those confusions to rest and explain all these in simple and effective way. So, in essence this article is no rocket science, but HTTP basics which most of those HTTP/IIS experts left out thinking that it would not be necessary to be explained (Or maybe its there but I missed noticing it).&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;Is HTTP a popular protocol, Oh really?&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;The popularity of HTTP protocol is simply because it's a simple protocol when you try to understand it from grass root level. Because of the simplicity (huh, I think due to recent developments people have made it a little complex) HTTP is used extensively not just for serving HTML pages but in order to empower several applications to make it work on the web.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;How does a simple HTTP response look like?&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;
&lt;TABLE class=MsoTableGrid cellSpacing=0 cellPadding=0&gt;

&lt;TR&gt;
&lt;TD&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;#include &amp;lt;iostream.h&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;#include &amp;lt;windows.h&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;int main (int argc, char** argv,char **envp)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;cout &amp;lt;&amp;lt; "Content-Type: text/html\r\n\r\n"; &lt;FONT color=#006400&gt;//Header&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;cout &amp;lt;&amp;lt; "&amp;lt;h2&amp;gt;Hello World!&amp;lt;/h2&amp;gt;" &amp;lt;&amp;lt;endl;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;FONT color=#006400&gt;//Body&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;return 1;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TABLE&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;How does HTTP works with authenticated request?&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI class=MsoNormal&gt;&lt;SPAN&gt;Browser send GET request to IIS (remember 1&lt;SUP&gt;st&lt;/SUP&gt; request is always anonymous)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt; 
&lt;LI class=MsoNormal&gt;&lt;SPAN&gt;IIS returns 401 and provides WWW-Authenticate Header with the supported authentication methods&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt; 
&lt;LI class=MsoNormal&gt;&lt;SPAN&gt;According to authentication method Browser pop-up the dialog to enter credentials and then submits to IIS&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt; 
&lt;LI class=MsoNormal&gt;&lt;SPAN&gt;Credentials gets validated and if valid, your GET request is served with HTTP Status 200 (200 = success)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;Why do we need sessions in HTTP?&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;Since HTTP is a connection-less protocol we need to provide a way to continue request-response process without having to create a ‘fresh’ newer connection for every request.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.iis.net/aggbug.aspx?PostID=1304056" width="1" height="1"&gt;</description><category domain="http://blogs.iis.net/sukesh/archive/tags/HTTP+_2600_amp_3B00_+IIS/default.aspx">HTTP &amp;amp; IIS</category></item></channel></rss>