<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="html">Scott Forsyth's Blog</title><subtitle type="html">Postings on IIS, ASP.NET, SQL Server, Webfarms and general system admin.</subtitle><id>http://weblogs.asp.net/owscott/atom.aspx</id><link rel="alternate" type="text/html" href="http://weblogs.asp.net/owscott/default.aspx" /><link rel="self" type="application/atom+xml" href="http://weblogs.asp.net/owscott/atom.aspx" /><generator uri="http://communityserver.org" version="3.0.20510.895">Community Server</generator><updated>2012-01-23T11:34:37Z</updated><entry><title>Why is the IIS default app pool recycle set to 1740 minutes?</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/owscott/archive/2013/04/06/why-is-the-iis-default-app-pool-recycle-set-to-1740-minutes.aspx" /><id>http://weblogs.asp.net/owscott/archive/2013/04/06/why-is-the-iis-default-app-pool-recycle-set-to-1740-minutes.aspx</id><published>2013-04-06T15:06:23Z</published><updated>2013-04-06T15:06:23Z</updated><content type="html">&lt;p&gt;Microsoft IIS Server has what appears to be an odd default for the application pool recycle time. It defaults to 1740 minutes, which is exactly 29 hours. I’ve always been a bit curious where that default came from. If you’re like me, you may have wondered too.&lt;/p&gt;  &lt;p&gt;Wonder no longer! While at the MVP Summit this year in Bellevue WA I had the privilege again of talking with the IIS team. &lt;a href="http://blogs.iis.net/wadeh/" target="_blank"&gt;Wade Hilmo&lt;/a&gt; was there too. Somehow in the conversation a discussion about IIS default settings came up, which included the odd 1740 minutes for the app pool recycle interval. Wade told the story of how the setting came into being, and he granted me permission to share.&lt;/p&gt;  &lt;p&gt;As you can imagine, many decisions for the large set of products produced by Microsoft come about after a lot of deliberation and research. Others have a geeky and fun origin. This is one of the latter.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;The 1740 story&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/owscott/image_4B9CE0C5.png"&gt;&lt;img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://weblogs.asp.net/blogs/owscott/image_thumb_06F04684.png" width="412" height="314" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Back when IIS 6 was being developed—which is the version that introduced application pools—a default needed to be set for the &lt;em&gt;Regular Time Interval&lt;/em&gt; when application pools are automatically recycled. &lt;/p&gt;  &lt;p&gt;Wade suggested 29 hours for the simple reason that &lt;strong&gt;&lt;em&gt;it’s the smallest prime number over 24&lt;/em&gt;&lt;/strong&gt;. He wanted a staggered and non-repeating pattern that doesn’t occur more frequently than once per day. In Wade’s words: “you don’t get a resonate pattern”. The default has been 1740 minutes (29 hours) ever since!&lt;/p&gt;  &lt;p&gt;That’s a fun little tidbit on the origin of the 1740. How about in your environment though? What is a good default?&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Practical guidelines&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;First off, I think 29 hours is a good default. For a situation where you don’t know the environment, which is the case for a default setting, having a non-resonate pattern greater than one day is a good idea. &lt;/p&gt;  &lt;p&gt;However, since you likely know your environment, it’s best to change this. &lt;strong&gt;I recommend&lt;/strong&gt; setting to a fixed time like 4:00am if you’re on the East coast of the US, 1:00am on the West coast, or whatever seems to make sense for your audience when you have the least amount of traffic. Setting it to a fixed time each day during low traffic times will minimize the impact and also allow you to troubleshoot easier if you run into any issues. If you have multiple application pools it may be wise to stagger them so that you don’t overload the server with a lot of simultaneous recycles.&lt;/p&gt;  &lt;p&gt;Note that IIS overlaps the app pool when recycling so there usually isn’t any downtime during a recycle. However, in-memory information (session state, etc) is lost. See this video if you want to learn more about &lt;a href="http://weblogs.asp.net/owscott/archive/2011/04/17/iis-s-overlapping-app-pools-week-16.aspx" target="_blank"&gt;IIS overlapping app pools&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;You may ask whether a fixed recycle is even needed. A daily recycle is just a band-aid to freshen IIS in case there is a slight memory leak or anything else that slowly creeps into the worker process. In theory you don’t need a daily recycle unless you have a known problem. I used to recommend that you turn it off completely if you don’t need it. However, I’m leaning more today towards setting it to recycle once per day at an off-peak time as a proactive measure. &lt;/p&gt;  &lt;p&gt;My reason is that, first, your site should be able to survive a recycle without too much impact, so recycling daily shouldn’t be a concern. Secondly, I’ve found that even well behaving app pools can eventually have something sneak in over time that impacts the app pool. I’ve seen issues from traffic patterns that cause excessive caching or something odd in the application, and I’ve seen the very rare IIS bug (rare indeed!) that isn’t a problem if recycled daily. Is it a band-aid? Possibly, but if a daily recycle keeps a non-critical issue from bubbling to the top then I believe that it’s a good proactive measure to save a lot of troubleshooting effort on something that probably isn’t important to troubleshoot. However, if you think you have a real issue that is being suppressed by recycling then, by all means, turn off the auto-recycling so that you can track down and resolve your issue. There’s no black and white answer. Only you can make the best decision for your environment.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Idle Time-out&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;While on the topic of app pool defaults, there is one more that you should change with every new server deployment. The &lt;em&gt;Idle Time-out&lt;/em&gt; should be set to 0 unless you are doing bulk hosting where you want to keep the memory footprint per site as low as possible. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/owscott/image_56C8FBC0.png"&gt;&lt;img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://weblogs.asp.net/blogs/owscott/image_thumb_24652841.png" width="368" height="450" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;If you have a just a few sites on your server and you want them to always load fast then set this to zero. Otherwise, when you have 20 minutes without any traffic then the app pool will terminate so that it can start up again on the next visit. The problem is that the first visit to an app pool needs to create a new w3wp.exe worker process which is slow because the app pool needs to be created, ASP.NET or another framework needs to be loaded, and then your application needs to be loaded. That can take a few seconds. Therefore I set that to 0 every chance I have, unless it’s for a server that hosts a lot of sites that don’t always need to be running.&lt;/p&gt;  &lt;p&gt;There are other settings that can be reviewed for each environment but the two aforementioned settings are the two that should be changed almost every time.&lt;/p&gt;  &lt;p&gt;Hopefully you enjoyed knowing about the 29 hour default as much as I did, even if just for fun. Happy IISing.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=10104757" width="1" height="1"&gt;</content><author><name>OWScott</name><uri>http://weblogs.asp.net/members/OWScott.aspx</uri></author><category term="IIS" scheme="http://weblogs.asp.net/owscott/archive/tags/IIS/default.aspx" /><category term="Performance Tuning" scheme="http://weblogs.asp.net/owscott/archive/tags/Performance+Tuning/default.aspx" /><category term="IIS7" scheme="http://weblogs.asp.net/owscott/archive/tags/IIS7/default.aspx" /><category term="Windows Server" scheme="http://weblogs.asp.net/owscott/archive/tags/Windows+Server/default.aspx" /><category term="IIS8" scheme="http://weblogs.asp.net/owscott/archive/tags/IIS8/default.aspx" /></entry><entry><title>Using WebDAV with ARR</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/owscott/archive/2013/01/29/using-webdav-with-arr.aspx" /><id>http://weblogs.asp.net/owscott/archive/2013/01/29/using-webdav-with-arr.aspx</id><published>2013-01-29T17:33:32Z</published><updated>2013-01-29T17:33:32Z</updated><content type="html">&lt;p&gt;Application Request Routing (ARR) is a great solution for load balancing and other proxying needs. I’m a big fan and have &lt;a href="http://weblogs.asp.net/owscott/archive/tags/ARR/default.aspx" target="_blank"&gt;written often&lt;/a&gt; about it.&lt;/p&gt;  &lt;p&gt;I had someone ask me this week about WebDAV support for ARR. With his ARR setup, he noted that WebDAV creation, uploads, and downloads worked well, but renaming and moving files did not. He aptly noticed in the IIS logs that the source IP address showed as being from the ARR server rather than from the original user.&lt;/p&gt;  &lt;p&gt;Here’s what the IIS log recorded:&lt;/p&gt;  &lt;div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4"&gt;   &lt;pre id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;2013-01-28 10:36:20 10.11.12.13 MOVE /Documents/test https://domain.com/Documents/test 80 User 10.9.8.7 Microsoft-WebDAV-MiniRedir/6.1.7601 400 1 0 31&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;div id="codeSnippetWrapper"&gt;The 10.9.8.7 IP Address is an IP address on the ARR server. And yes, the real IP address has been replaced with a made-up IP to protect the innocent.&lt;/div&gt;

&lt;div&gt;&amp;#160;&lt;/div&gt;

&lt;div&gt;To be honest, I haven’t tested WebDAV with ARR yet, but the issue sounded like the proxy-in-the-middle issue. I suggested installing &lt;a href="http://blogs.iis.net/anilr/archive/2009/03/03/client-ip-not-logged-on-content-server-when-using-arr.aspx" target="_blank"&gt;ARRHelper&lt;/a&gt; on the web servers, and sure enough, that took care of it. While I didn’t setup a full repro myself, he confirmed that it worked for him after the ARRHelper install so I feel quite confident in saying that WebDAV will work with ARR as long as ARRHelper is installed.&lt;/div&gt;

&lt;p&gt;So for anyone working with WebDAV and ARR and it doesn’t work for you, it’s likely that ARRHelper needs to be installed on the web servers.&lt;/p&gt;

&lt;p&gt;You can find ARRHelper &lt;a href="http://blogs.iis.net/anilr/archive/2009/03/03/client-ip-not-logged-on-content-server-when-using-arr.aspx" target="_blank"&gt;here&lt;/a&gt;, and if interested, I have a &lt;a href="http://weblogs.asp.net/owscott/archive/2011/08/24/arr-helper-week-33.aspx" target="_blank"&gt;short video&lt;/a&gt; explaining what it is and why it’s important.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=9813663" width="1" height="1"&gt;</content><author><name>OWScott</name><uri>http://weblogs.asp.net/members/OWScott.aspx</uri></author><category term="IIS" scheme="http://weblogs.asp.net/owscott/archive/tags/IIS/default.aspx" /><category term="IIS7" scheme="http://weblogs.asp.net/owscott/archive/tags/IIS7/default.aspx" /><category term="ARR" scheme="http://weblogs.asp.net/owscott/archive/tags/ARR/default.aspx" /><category term="IIS8" scheme="http://weblogs.asp.net/owscott/archive/tags/IIS8/default.aspx" /></entry><entry><title>Handing MVC paths with dots in the path</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/owscott/archive/2013/01/16/handing-mvc-paths-with-dots-in-the-path.aspx" /><id>http://weblogs.asp.net/owscott/archive/2013/01/16/handing-mvc-paths-with-dots-in-the-path.aspx</id><published>2013-01-16T14:37:42Z</published><updated>2013-01-16T14:37:42Z</updated><content type="html">&lt;p&gt;A friend of mine asked me recently how to handle a situation with a dot (.) in the path for an MVC project.&amp;#160; The path looked something like this:&lt;/p&gt;  &lt;p&gt;http://domain.com/aspnet/CLR4.0&lt;/p&gt;  &lt;p&gt;The MVC routes didn’t work for this path and the standard IIS 404 handler served up the page instead. However, the following URL did work:&lt;/p&gt;  &lt;p&gt;http://domain.com/aspnet/CLR4.0/&lt;/p&gt;  &lt;p&gt;The only difference is the trailing slash. For anyone that runs into the same situation, here’s the reason and the solution.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;What causes this inconsistency&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;The issue with the first path is that IIS can’t tell if the path is a file or folder. In fact, it looks so much like a file with an extension of .0 then that’s what IIS assumes that it is. However, the second path is fine because the trailing slash makes it obvious that it’s a folder.&lt;/p&gt;  &lt;p&gt;We can’t just assign a wildcard handler to MVC in IIS for all file types because that will break files like .css, .js, .png, and other files are processed as static images.&lt;/p&gt;  &lt;p&gt;Note that this would not be an issue if the dot is in a different part of the path. It’s only an issue if the dot is in the last section. For example, the following would be fine:&lt;/p&gt;  &lt;p&gt;http://domain.com/aspnet/CLR4.0/info&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;So how do we resolve it?&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;As I mentioned, we can’t simply set a wildcard handler on it because it will break other necessary static files. So have about three options:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;You could always change the paths in your application. If you’re early enough in the development cycle that may be an option for you. &lt;/li&gt;    &lt;li&gt;Add file handlers for all extension types that you may have. For example, add a handler for .0, another for .1, etc. &lt;/li&gt;    &lt;li&gt;Use a URL rewriter like IIS URL Rewrite to watch for a particular pattern and append the training slash. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Let’s look at these second two options. I’ll mention now up front that the URL Rewrite solution is probably the best bet, although I’ll cover both in case you prefer the handler method.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Http Handler Solution&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;You can handle specific extensions by adding a handler for each possible extension that you’ll support. This maps to System.Web.UI.PageHandlerFactory so that ASP.NET MVC has a handle on it and you can create an MVC route for it. This would apply to ASP.NET, PHP, or other frameworks too.&lt;/p&gt;  &lt;div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4"&gt;   &lt;pre id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;C:\Windows\System32\inetsrv\appcmd.exe set config &amp;quot;Sitename&amp;quot; -section:system.webServer/handlers /+&amp;quot;[name='.0-PageHandlerFactory-Integrated-4.0',path='*.0',verb='GET,HEAD,POST,DEBUG',type='System.Web.UI.PageHandlerFactory',preCondition='integratedMode']&amp;quot; /commit:apphost&lt;br /&gt;C:\Windows\System32\inetsrv\appcmd.exe set config &amp;quot;SiteName&amp;quot; -section:system.webServer/handlers /+&amp;quot;[name='.1-PageHandlerFactory-Integrated-4.0',path='*.1',verb='GET,HEAD,POST,DEBUG',type='System.Web.UI.PageHandlerFactory',preCondition='integratedMode']&amp;quot; /commit:apphost&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;Run this appcmd command from the command prompt to create the handlers.&lt;/p&gt;

&lt;p&gt;Make sure to update “Sitename” with your own site name, or leave it off to make it a server-wide change. And you can update ‘*.0’, ‘*.1’ to your extensions.&lt;/p&gt;

&lt;p&gt;If you do create the site-level rule, make sure to save your web.config back to your source control so that you don’t overwrite it on your next site update.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;IIS URL Rewrite Solution&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Probably the best solution, and the one that my friend used in this case, is to use URL Rewrite to add a trailing slash when needed. The advantage of this is that you can use a more general pattern to redirect the URL rather than a bunch of handlers for each specific extension.&lt;/p&gt;

&lt;p&gt;This assumes that you have IIS 7.0 or greater and that you have URL Rewrite installed. If you’re not familiar with URL Rewrite, check out the &lt;a href="http://weblogs.asp.net/owscott/archive/tags/URL+Rewrite/default.aspx" target="_blank"&gt;URL Rewrite articles&lt;/a&gt; on my blog (start with &lt;a href="http://weblogs.asp.net/owscott/archive/2009/11/27/iis-url-rewrite-rewriting-non-www-to-www.aspx" target="_blank"&gt;this one&lt;/a&gt;). &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: If you want, you can skip this section and jump right to the next section for an easier way to do this using URL Rewrite’s rule wizard.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The following rule watches for a pattern of exactly “something.{digits}” (without a trailing slash). If it finds it then it performs a redirect and appends the trailing slash. It also confirms that it’s not a file or directory that exists on disk.&lt;/p&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;pre id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;rule&lt;/span&gt; &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Add trailing slash for some URLs&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;stopProcessing&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;true&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;match&lt;/span&gt; &lt;span style="color: #ff0000"&gt;url&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;^(.*\.(\d)+)$&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;conditions&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;add&lt;/span&gt; &lt;span style="color: #ff0000"&gt;input&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;{REQUEST_FILENAME}&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;matchType&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;IsFile&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;negate&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;true&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;add&lt;/span&gt; &lt;span style="color: #ff0000"&gt;input&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;{REQUEST_FILENAME}&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;matchType&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;IsDirectory&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;negate&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;true&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;conditions&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;action&lt;/span&gt; &lt;span style="color: #ff0000"&gt;type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Redirect&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;url&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;{R:1}/&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;rule&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;To apply this rule, using IIS Manager you can create a dummy rule as a placeholder and then edit web.config and replace your placeholder rule with this rule. If this still doesn’t make sense then be sure to review the articles I mentioned above. The configuration location is in &amp;lt;configuration&amp;gt;&amp;lt;system.webServer&amp;gt;&amp;lt;rules&amp;gt;&lt;strong&gt;&amp;lt;rule&amp;gt;&lt;/strong&gt;…&lt;/p&gt;

&lt;p&gt;An added benefit of this rule is that you’ll make the search engines happy by having just one path for each page, rather than possibly two with and without the slash. This will help with your SEO rankings.&lt;/p&gt;

&lt;p&gt;I didn’t think of it at the time but just now I realized that you could use a general match url pattern of “.(*[^/])” and it will work for you too. The reason is that the check for IsFile and IsDirectory will ensure that your static images will continue to be served directly from disk so you won’t break them. So feel free to use &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;match&lt;/span&gt; &lt;span style="color: #ff0000"&gt;url&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;(.*[^/])&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt; instead if you want to add the trailing slash for all paths that don’t have them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Real Easy Solution (URL Rewrite wizard)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In fact, to make this easier yet, you can use URL Rewrite’s existing rule wizard to add the trailing slash. You must apply this at the site or folder level since the trailing slash wizard doesn’t exist at the server level.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;From IIS Manager, open URL Rewrite at the site or folder level.
    &lt;br /&gt;&lt;a href="http://weblogs.asp.net/blogs/owscott/image_23C215ED.png"&gt;&lt;img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://weblogs.asp.net/blogs/owscott/image_thumb_359EA9BA.png" width="96" height="71" /&gt;&lt;/a&gt;&lt;/li&gt;

  &lt;li&gt;Click “Add Rule(s)…” from the Actions pane.
    &lt;br /&gt;&lt;a href="http://weblogs.asp.net/blogs/owscott/SNAGHTML14017621_033AD63B.png"&gt;&lt;img title="SNAGHTML14017621" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="SNAGHTML14017621" src="http://weblogs.asp.net/blogs/owscott/SNAGHTML14017621_thumb_2E133A4D.png" width="209" height="169" /&gt;&lt;/a&gt;&lt;/li&gt;

  &lt;li&gt;Select “Append or remove the trailing slash symbol” rule.
    &lt;br /&gt;&lt;a href="http://weblogs.asp.net/blogs/owscott/image_299CB986.png"&gt;&lt;img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://weblogs.asp.net/blogs/owscott/image_thumb_4D55E120.png" width="356" height="239" /&gt;&lt;/a&gt;&lt;/li&gt;

  &lt;li&gt;Use the default option of “Appended if it does not exist”&lt;/li&gt;

  &lt;li&gt;Press &lt;strong&gt;OK&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That’s it! You’ll have a rule added which will append the trailing slash for all non-physical file or folder paths that don’t already have the trailing slash. Not only will it handle dots in the path but the search engines will be happy too.&lt;/p&gt;

&lt;p&gt;As with the http extension solution, if you create this as a site or folder-level rule, it will be applied to your web.config file. Make sure to update web.config in your source control so that you don’t lose your changes on your next site deployment.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=9759987" width="1" height="1"&gt;</content><author><name>OWScott</name><uri>http://weblogs.asp.net/members/OWScott.aspx</uri></author><category term="IIS" scheme="http://weblogs.asp.net/owscott/archive/tags/IIS/default.aspx" /><category term="ASP.NET" scheme="http://weblogs.asp.net/owscott/archive/tags/ASP.NET/default.aspx" /><category term="IIS7" scheme="http://weblogs.asp.net/owscott/archive/tags/IIS7/default.aspx" /><category term="URL Rewrite" scheme="http://weblogs.asp.net/owscott/archive/tags/URL+Rewrite/default.aspx" /><category term="MVC" scheme="http://weblogs.asp.net/owscott/archive/tags/MVC/default.aspx" /><category term="IIS8" scheme="http://weblogs.asp.net/owscott/archive/tags/IIS8/default.aspx" /></entry><entry><title>Windows 8 / IIS 8 Concurrent Requests Limit</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/owscott/archive/2012/11/13/windows-8-iis-8-concurrent-requests-limit.aspx" /><id>http://weblogs.asp.net/owscott/archive/2012/11/13/windows-8-iis-8-concurrent-requests-limit.aspx</id><published>2012-11-13T22:14:00Z</published><updated>2012-11-13T22:14:00Z</updated><content type="html">&lt;p&gt;IIS 8 on &lt;em&gt;Windows Server 2012 &lt;/em&gt;doesn’t have any fixed concurrent request limit, apart from whatever limit would be reached when resources are maxed.&lt;/p&gt;  &lt;p&gt;However, the client version of IIS 8, which is on Windows 8, does have a concurrent connection request limitation to limit high traffic production uses on a client edition of Windows.&lt;/p&gt;  &lt;p&gt;Starting with IIS 7 (Windows Vista), the behavior changed from previous versions.&amp;nbsp; In previous client versions of IIS, excess requests would throw a 403.9 error message (Access Forbidden: Too many users are connected.).&amp;nbsp; Instead, Windows Vista, 7 and 8 queue excessive requests so that they will be handled gracefully, although there is a maximum number of requests that will be processed simultaneously.&lt;/p&gt;  &lt;p&gt;Thomas Deml provided a &lt;a href="http://blogs.iis.net/thomad/archive/2008/05/01/understanding-iis7-request-restrictions-on-windows-vista.aspx" target="_blank" mce_href="http://blogs.iis.net/thomad/archive/2008/05/01/understanding-iis7-request-restrictions-on-windows-vista.aspx"&gt;concurrent request chart&lt;/a&gt; for Windows Vista many years ago, but I have been unable to find an equivalent chart for Windows 8 so I asked &lt;a href="http://blogs.iis.net/wadeh/" target="_blank" mce_href="http://blogs.iis.net/wadeh/"&gt;Wade Hilmo&lt;/a&gt; from the IIS team what the limits are.&amp;nbsp; Since this is controlled not by the IIS team itself but rather from the Windows licensing team, he asked around and found the authoritative answer, which I’ll provide below.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Windows 8 – IIS 8 Concurrent Requests Limit&lt;/strong&gt;&lt;/p&gt;  &lt;table width="514" border="0" cellspacing="0" cellpadding="2"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td width="250" valign="top"&gt;Windows 8 (Basic edition)&lt;/td&gt;        &lt;td width="262" valign="top"&gt;3&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td width="250" valign="top"&gt;Windows 8 Professional, Enterprise&lt;/td&gt;        &lt;td width="262" valign="top"&gt;10&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td width="250" valign="top"&gt;Windows RT&lt;/td&gt;        &lt;td width="262" valign="top"&gt;N/A since IIS does not run on Windows RT&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;&lt;strong&gt;Windows 7 – IIS 7.5 Concurrent Requests Limit&lt;/strong&gt;&lt;/p&gt;  &lt;table width="400" border="0" cellspacing="0" cellpadding="2"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td width="255" valign="top"&gt;Windows 7 Home Starter&lt;/td&gt;        &lt;td width="145" valign="top"&gt;1&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td width="255" valign="top"&gt;Windows 7 Basic&lt;/td&gt;        &lt;td width="145" valign="top"&gt;1&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td width="255" valign="top"&gt;Windows 7 Premium&lt;/td&gt;        &lt;td width="145" valign="top"&gt;3&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td width="255" valign="top"&gt;Windows 7 Ultimate, Professional, Enterprise&lt;/td&gt;        &lt;td width="145" valign="top"&gt;10&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;&lt;strong&gt;Windows Vista – IIS 7 Concurrent Requests Limit&lt;/strong&gt;&lt;/p&gt;  &lt;table width="400" border="0" cellspacing="0" cellpadding="2"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td width="259" valign="top"&gt;Windows Vista Home Basic (IIS process activation and HTTP processing only)&lt;/td&gt;        &lt;td width="141" valign="top"&gt;3&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td width="259" valign="top"&gt;Windows Vista Home Premium&lt;/td&gt;        &lt;td width="141" valign="top"&gt;3&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td width="259" valign="top"&gt;Windows Vista Ultimate, Professional, Enterprise&lt;/td&gt;        &lt;td width="141" valign="top"&gt;10&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;Windows Server 2003, Windows Server 2008, Windows Server 2008 R2 and Windows Server 2012 allow an unlimited amount of simultaneously requests.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=9383763" width="1" height="1"&gt;</content><author><name>OWScott</name><uri>http://weblogs.asp.net/members/OWScott.aspx</uri></author><category term="IIS" scheme="http://weblogs.asp.net/owscott/archive/tags/IIS/default.aspx" /><category term="Windows Vista" scheme="http://weblogs.asp.net/owscott/archive/tags/Windows+Vista/default.aspx" /><category term="IIS7" scheme="http://weblogs.asp.net/owscott/archive/tags/IIS7/default.aspx" /><category term="Windows 7" scheme="http://weblogs.asp.net/owscott/archive/tags/Windows+7/default.aspx" /><category term="Windows Server 8" scheme="http://weblogs.asp.net/owscott/archive/tags/Windows+Server+8/default.aspx" /><category term="IIS8" scheme="http://weblogs.asp.net/owscott/archive/tags/IIS8/default.aspx" /></entry><entry><title>URL Rewrite – Protocol (http/https) in the Action</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/owscott/archive/2012/11/07/url-rewrite-protocol-http-https-in-the-action.aspx" /><id>http://weblogs.asp.net/owscott/archive/2012/11/07/url-rewrite-protocol-http-https-in-the-action.aspx</id><published>2012-11-07T14:04:02Z</published><updated>2012-11-07T14:04:02Z</updated><content type="html">&lt;p&gt;IIS URL Rewrite supports server variables for pretty much every part of the URL and http header. However, there is one commonly used server variable that isn’t readily available.&amp;#160; That’s the protocol—HTTP or HTTPS.&lt;/p&gt;  &lt;p&gt;You can easily check if a page request uses HTTP or HTTPS, but that only works in the &lt;em&gt;conditions &lt;/em&gt;part of the rule.&amp;#160; There isn’t a variable available to dynamically set the protocol in the &lt;em&gt;action &lt;/em&gt;part of the rule.&amp;#160; What I wish is that there would be a variable like {HTTP_PROTOCOL} which would have a value of ‘HTTP’ or ‘HTTPS’.&amp;#160; There is a server variable called {HTTPS}, but the values of ‘on’ and ‘off’ aren’t practical in the &lt;em&gt;action&lt;/em&gt;.&amp;#160; You can also use {SERVER_PORT} or {SERVER_PORT_SECURE}, but again, they aren’t useful in the &lt;em&gt;action&lt;/em&gt;.&lt;/p&gt;  &lt;p&gt;Let me illustrate.&amp;#160; The following rule will redirect traffic for http(s)://localtest.me/ to http://www.localtest.me/.&lt;/p&gt;  &lt;div id="codeSnippetWrapper"&gt;   &lt;div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;     &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;rule&lt;/span&gt; &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Redirect to www&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;match&lt;/span&gt; &lt;span style="color: #ff0000"&gt;url&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;(.*)&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;conditions&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;add&lt;/span&gt; &lt;span style="color: #ff0000"&gt;input&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;{HTTP_HOST}&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;pattern&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;^localtest\.me$&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;conditions&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;action&lt;/span&gt; &lt;span style="color: #ff0000"&gt;type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Redirect&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;url&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;http://www.localtest.me/{R:1}&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;rule&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;The problem is that it forces the request to HTTP even if the original request was for HTTPS.&lt;/p&gt;

&lt;p&gt;Interestingly enough, I planned to blog about this topic this week when I noticed in my twitter feed yesterday that Jeff Graves, a former colleague of mine, just wrote an &lt;a href="http://jeffgraves.me/2012/11/06/maintain-protocol-in-url-rewrite-rules/" target="_blank"&gt;excellent blog post&lt;/a&gt; about this very topic.&amp;#160; He beat me to the punch by just a couple days.&amp;#160; However, I figured I would still write my blog post on this topic.&amp;#160; While his solution is a excellent one, I personally handle this another way most of the time.&amp;#160; Plus, it’s a commonly asked question that isn’t documented well enough on the web yet, so having another article on the web won’t hurt.&lt;/p&gt;

&lt;p&gt;I can think of four different ways to handle this, and depending on your situation you may lean towards any of the four.&amp;#160; Don’t let the choices overwhelm you though.&amp;#160; Let’s keep it simple, Option 1 is what I use most of the time, Option 2 is what Jeff proposed and is the safest option, and Option 3 and Option 4 need only be considered if you have a more unique situation.&amp;#160; All four options will work for most situations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Option 1 – CACHE_URL, single rule&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;There is a server variable that has the protocol in it; {CACHE_URL}.&amp;#160; This server variable contains the entire URL string (e.g. http://www.localtest.me:80/info.aspx?id=5)&amp;#160; All we need to do is extract the HTTP or HTTPS and we’ll be set. This tends to be my preferred way to handle this situation.&lt;/p&gt;

&lt;p&gt;Indeed, Jeff did briefly mention this in his blog post: &lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;… you could use a condition on the CACHE_URL variable and a back reference in the rewritten URL. The problem there is that you then need to match all of the conditions which could be a problem if your rule depends on a logical “or” match for conditions.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Thus the problem.&amp;#160; If you have multiple conditions set to “Match Any” rather than “Match All” then this option won’t work.&amp;#160; However, I find that 95% of all rules that I write use “Match All” and therefore, being the &lt;a href="http://www.codinghorror.com/blog/2005/08/how-to-be-lazy-dumb-and-successful.html" target="_blank"&gt;lazy administrator&lt;/a&gt; that I am I like this simple solution that only requires adding a single condition to a rule.&amp;#160; The caveat is that if you use “Match Any” then you must consider one of the next two options.&lt;/p&gt;

&lt;p&gt;Enough with the preamble.&amp;#160; Here’s how it works.&amp;#160; Add a condition that checks for {CACHE_URL} with a pattern of “^(.+)://” like so:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/owscott/image_40CAB90C.png"&gt;&lt;img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://weblogs.asp.net/blogs/owscott/image_thumb_5664F1A9.png" width="436" height="290" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;How you have a back-reference to the part before the ://, which is our treasured HTTP or HTTPS.&amp;#160; In URL Rewrite 2.0 or greater you can check the “Track capture groups across conditions”, make that condition the first condition, and you have yourself a back-reference of {C:1}.&lt;/p&gt;

&lt;p&gt;The “Redirect to www” example with support for maintaining the protocol, will become:&lt;/p&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;
    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;rule&lt;/span&gt; &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Redirect to www&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;stopProcessing&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;true&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;match&lt;/span&gt; &lt;span style="color: #ff0000"&gt;url&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;(.*)&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;conditions&lt;/span&gt; &lt;span style="color: #ff0000"&gt;trackAllCaptures&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;true&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;add&lt;/span&gt; &lt;span style="color: #ff0000"&gt;input&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;{CACHE_URL}&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;pattern&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;^(.+)://&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;add&lt;/span&gt; &lt;span style="color: #ff0000"&gt;input&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;{HTTP_HOST}&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;pattern&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;^localtest\.me$&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;conditions&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;action&lt;/span&gt; &lt;span style="color: #ff0000"&gt;type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Redirect&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;url&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;{C:1}://www.localtest.me/{R:1}&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;rule&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;It’s not as easy as it would be if Microsoft gave us a built-in {HTTP_PROTOCOL} variable, but it’s pretty close.&lt;/p&gt;

&lt;p&gt;I also like this option since I often create rule examples for other people and this type of rule is portable since it’s self-contained within a single rule.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Option 2 – Using a Rewrite Map&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For a safer rule that works for both “Match Any” and “Match All” situations, you can use the Rewrite Map solution that &lt;a href="http://jeffgraves.me/2012/11/06/maintain-protocol-in-url-rewrite-rules/" target="_blank"&gt;Jeff proposed&lt;/a&gt;.&amp;#160; It’s a perfectly good solution with the only drawback being the ever so slight extra effort to set it up since you need to create a rewrite map before you create the rule.&amp;#160; In other words, if you choose to use this as your sole method of handling the protocol, you’ll be safe.&lt;/p&gt;

&lt;p&gt;After you create a Rewrite Map called MapProtocol, you can use “{MapProtocol:{HTTPS}}” for the protocol within any rule action.&amp;#160; Following is an example using a Rewrite Map.&lt;/p&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;
    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;rewrite&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;rules&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;rule&lt;/span&gt; &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Redirect to www&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;stopProcessing&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;true&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;      &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;match&lt;/span&gt; &lt;span style="color: #ff0000"&gt;url&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;(.*)&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"&gt;      &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;conditions&lt;/span&gt; &lt;span style="color: #ff0000"&gt;trackAllCaptures&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;false&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;        &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;add&lt;/span&gt; &lt;span style="color: #ff0000"&gt;input&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;{HTTP_HOST}&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;pattern&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;^localtest\.me$&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"&gt;      &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;conditions&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;      &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;action&lt;/span&gt; &lt;span style="color: #ff0000"&gt;type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Redirect&amp;quot;&lt;/span&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"&gt;        &lt;span style="color: #ff0000"&gt;url&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;{MapProtocol:{HTTPS}}://www.localtest.me/{R:1}&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;rule&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;rules&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;rewriteMaps&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;rewriteMap&lt;/span&gt; &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;MapProtocol&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;      &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;add&lt;/span&gt; &lt;span style="color: #ff0000"&gt;key&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;on&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;value&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;https&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"&gt;      &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;add&lt;/span&gt; &lt;span style="color: #ff0000"&gt;key&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;off&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;value&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;http&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;rewriteMap&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;rewriteMaps&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;rewrite&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Option 3 – CACHE_URL, Multi-rule &lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you have many rules that will use the protocol, you can create your own server variable which can be used in subsequent rules. This option is no easier to set up than Option 2 above, but you can use it if you prefer the easier to remember syntax of {HTTP_PROTOCOL} vs. {MapProtocol:{HTTPS}}.&lt;/p&gt;

&lt;p&gt;The potential issue with this rule is that if you don’t have access to the server level (e.g. in a shared environment) then you cannot set server variables without permission.&lt;/p&gt;

&lt;p&gt;First, create a rule and place it at the top of the set of rules.&amp;#160; You can create this at the server, site or subfolder level.&amp;#160; However, if you create it at the site or subfolder level then the HTTP_PROTOCOL server variable needs to be approved at the server level.&amp;#160; This can be achieved in IIS Manager by navigating to URL Rewrite at the server level, clicking on “View Server Variables” from the Actions pane, and added HTTP_PROTOCOL. If you create the rule at the server level then this step is not necessary.&amp;#160; &lt;/p&gt;

&lt;p&gt;Following is an example of the first rule to create the HTTP_PROTOCOL and then a rule that uses it.&amp;#160; The Create HTTP_PROTOCOL rule only needs to be created once on the server.&lt;/p&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;
    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;rule&lt;/span&gt; &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Create HTTP_PROTOCOL&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;match&lt;/span&gt; &lt;span style="color: #ff0000"&gt;url&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;.*&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;conditions&lt;/span&gt; &lt;span style="color: #ff0000"&gt;logicalGrouping&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;MatchAll&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;trackAllCaptures&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;false&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;add&lt;/span&gt; &lt;span style="color: #ff0000"&gt;input&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;{CACHE_URL}&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;pattern&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;^(.+)://&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;conditions&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;serverVariables&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;set&lt;/span&gt; &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;HTTP_PROTOCOL&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;value&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;{C:1}&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;serverVariables&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;action&lt;/span&gt; &lt;span style="color: #ff0000"&gt;type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;None&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;rule&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"&gt;&amp;#160;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;rule&lt;/span&gt; &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Redirect to www&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;stopProcessing&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;true&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;match&lt;/span&gt; &lt;span style="color: #ff0000"&gt;url&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;(.*)&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;conditions&lt;/span&gt; &lt;span style="color: #ff0000"&gt;logicalGrouping&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;MatchAll&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;trackAllCaptures&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;false&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;add&lt;/span&gt; &lt;span style="color: #ff0000"&gt;input&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;{HTTP_HOST}&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;pattern&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;^localtest\.me$&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;conditions&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;action&lt;/span&gt; &lt;span style="color: #ff0000"&gt;type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Redirect&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;url&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;{HTTP_PROTOCOL}://www.localtest.me/{R:1}&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;rule&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Option 4 – Multi-rule&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Just to be complete I’ll include an example of how to achieve the same thing with multiple rules. I don’t see any reason to use it over the previous examples, but I’ll include an example anyway.&amp;#160; Note that it will only work with the “Match All” setting for the conditions.&lt;/p&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;
    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;rule&lt;/span&gt; &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Redirect to www - http&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;stopProcessing&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;true&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;match&lt;/span&gt; &lt;span style="color: #ff0000"&gt;url&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;(.*)&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;conditions&lt;/span&gt; &lt;span style="color: #ff0000"&gt;logicalGrouping&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;MatchAll&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;trackAllCaptures&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;false&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;add&lt;/span&gt; &lt;span style="color: #ff0000"&gt;input&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;{HTTP_HOST}&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;pattern&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;^localtest\.me$&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;add&lt;/span&gt; &lt;span style="color: #ff0000"&gt;input&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;{HTTPS}&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;pattern&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;off&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;conditions&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;action&lt;/span&gt; &lt;span style="color: #ff0000"&gt;type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Redirect&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;url&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;http://www.localtest.me/{R:1}&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;rule&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;rule&lt;/span&gt; &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Redirect to www - https&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;stopProcessing&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;true&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;match&lt;/span&gt; &lt;span style="color: #ff0000"&gt;url&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;(.*)&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;conditions&lt;/span&gt; &lt;span style="color: #ff0000"&gt;logicalGrouping&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;MatchAll&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;trackAllCaptures&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;false&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;add&lt;/span&gt; &lt;span style="color: #ff0000"&gt;input&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;{HTTP_HOST}&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;pattern&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;^localtest\.me$&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;add&lt;/span&gt; &lt;span style="color: #ff0000"&gt;input&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;{HTTPS}&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;pattern&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;on&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;conditions&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;action&lt;/span&gt; &lt;span style="color: #ff0000"&gt;type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Redirect&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;url&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;https://www.localtest.me/{R:1}&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;rule&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Above are four working examples of methods to call the protocol (HTTP or HTTPS) from the action of a URL Rewrite rule.&amp;#160; You can use whichever method you most prefer.&amp;#160; I’ve listed them in the order that I favor them, although I could see some people preferring Option 2 as their first choice.&amp;#160; In any of the cases, hopefully you can use this as a reference for when you need to use the protocol in the rule’s action when writing your URL Rewrite rules.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Further information:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href="http://weblogs.asp.net/owscott/archive/2010/03/09/viewing-all-server-variables-for-a-site.aspx"&gt;Viewing all Server Variable&lt;/a&gt; for a site.&lt;/li&gt;

  &lt;li&gt;&lt;a href="http://weblogs.asp.net/owscott/archive/2010/04/20/url-parts-available-to-url-rewrite-rules.aspx"&gt;URL Parts&lt;/a&gt; available to URL Rewrite Rules&lt;/li&gt;

  &lt;li&gt;Further &lt;a href="http://weblogs.asp.net/owscott/archive/tags/URL+Rewrite/default.aspx" target="_blank"&gt;URL Rewrite articles&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=9329941" width="1" height="1"&gt;</content><author><name>OWScott</name><uri>http://weblogs.asp.net/members/OWScott.aspx</uri></author><category term="IIS" scheme="http://weblogs.asp.net/owscott/archive/tags/IIS/default.aspx" /><category term="IIS7" scheme="http://weblogs.asp.net/owscott/archive/tags/IIS7/default.aspx" /><category term="URL Rewrite" scheme="http://weblogs.asp.net/owscott/archive/tags/URL+Rewrite/default.aspx" /><category term="ARR" scheme="http://weblogs.asp.net/owscott/archive/tags/ARR/default.aspx" /><category term="IIS8" scheme="http://weblogs.asp.net/owscott/archive/tags/IIS8/default.aspx" /></entry><entry><title>Reading a memory.dmp or other .dmp file</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/owscott/archive/2012/07/18/reading-a-memory-dmp-or-other-dmp-file.aspx" /><id>http://weblogs.asp.net/owscott/archive/2012/07/18/reading-a-memory-dmp-or-other-dmp-file.aspx</id><published>2012-07-18T13:40:56Z</published><updated>2012-07-18T13:40:56Z</updated><content type="html">&lt;p&gt;While the dreaded Blue Screen of Death (BSOD) occurs less frequently with newer versions of Windows than it did in years past, there are still times when the BSOD reveals itself.&amp;#160; &lt;/p&gt;  &lt;p&gt;I just ran into four BSOD’s on two Windows Server 2012 machines and I had the ‘opportunity’ to analyze a memory.dmp file today, so I thought I would post quick instructions on how to get a handy summary of the memory dump.&lt;/p&gt;  &lt;p&gt;I’ve had this &lt;a href="http://www.ifoundafix.com/2008/02/05/reading-and-troubleshooting-the-windows-minidump-dmp-file/"&gt;”I Found a Fix” debugging page&lt;/a&gt; bookmarked for years and I’ve used it many times, so I need to give full credit to ifoundafix for their helpful steps.&amp;#160; The only change I have below is to include updated paths. &lt;/p&gt;  &lt;p&gt;It’s possible to debug remotely, and you may have requirements to do that.&amp;#160; My quick instructions here are for local debugging.&amp;#160; The debugging tools are very stable and if you install just what you need then they are small and a quick install, so running this on a production machine is generally safe, but you must make that decision for your particular environment.&lt;/p&gt;  &lt;p&gt;This can be accomplished with 7 easy steps:&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Step 1&lt;/strong&gt;. Obtain and install the debugging tools.&amp;#160; The links do change over time, but the following link is currently an exhaustive page which includes Windows Server 2012 and Windows 8 Consumer debugger tools, Windows 7, Vista, XP and Windows Server 2003.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/windows/hardware/gg463009.aspx"&gt;Debugging Tools Windows&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;All you need to install is the “Debugging Tools for Windows”.&amp;#160; Everything else is used for more advanced troubleshooting or development, and isn’t needed here.&amp;#160; Today I followed the link to “Install Debugging Tools for Windows as a Standalone Component (from Windows SDK)” although for a different OS you may need to follow a different link.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Step 2&lt;/strong&gt;. From the command prompt navigate to the debugging folder. For me with the latest tools on Windows Server 2012 it was at C:\Program Files (x86)\Windows Kits\8.0\Debuggers\x64\.&amp;#160; You can specify the path during the install.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Step 3&lt;/strong&gt;. Type the following:&lt;/p&gt;  &lt;p&gt;kd –z C:\Windows\memory.dmp (or the path to your .dmp file)&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Step 4&lt;/strong&gt;. Type the following:&lt;/p&gt;  &lt;p&gt;.logopen c:\debuglog.txt&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Step 5&lt;/strong&gt;. Type the following:&lt;/p&gt;  &lt;p&gt;.sympath srv*c:\symbols*http://msdl.microsoft.com/download/symbols&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Step 6&lt;/strong&gt;. Type the following:&lt;/p&gt;  &lt;p&gt;.reload;!analyze -v;r;kv;lmnt;.logclose;q&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Step 7&lt;/strong&gt;. Review the results by opening c:\debuglog.txt in your favorite text editor.&amp;#160; Searching for PROCESS_NAME: will show which process had the fault.&amp;#160; You can use the process name and other information from the dump to find clues and find answers in a web search.&amp;#160; Usually the fault is with a hardware drivers of some sort, but there are many things that can cause crashes so the actual analyzing of the dump may take some research.&lt;/p&gt;  &lt;p&gt;Often time a driver update will fix the issue.&amp;#160; If the summary information doesn’t offer enough information then you’ll need to dig further into the debugging tools or open a CSS case with Microsoft.&amp;#160; The steps above will provide you with a summary mostly-human-readable report from the dump.&amp;#160; There is much more information available in the memory dump although it gets exponentially more difficult to track down the details the further you get into windows debugging.&lt;/p&gt;  &lt;p&gt;Hopefully these quick steps are helpful for you as you troubleshoot the unwelcome BSOD.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8754893" width="1" height="1"&gt;</content><author><name>OWScott</name><uri>http://weblogs.asp.net/members/OWScott.aspx</uri></author><category term="Windows Server" scheme="http://weblogs.asp.net/owscott/archive/tags/Windows+Server/default.aspx" /><category term="Troubleshooting" scheme="http://weblogs.asp.net/owscott/archive/tags/Troubleshooting/default.aspx" /><category term="Windows Server 2012" scheme="http://weblogs.asp.net/owscott/archive/tags/Windows+Server+2012/default.aspx" /></entry><entry><title>Last Day With OrcsWeb</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/owscott/archive/2012/05/18/last-day-with-orcsweb.aspx" /><id>http://weblogs.asp.net/owscott/archive/2012/05/18/last-day-with-orcsweb.aspx</id><published>2012-05-19T03:29:20Z</published><updated>2012-05-19T03:29:20Z</updated><content type="html">&lt;p&gt;It’s hard to believe that it’s been 10 years since my first day at &lt;a href="http://www.orcsweb.com"&gt;OrcsWeb&lt;/a&gt;. Today is my last official day, but I’ll still be close by. I have a number of ties here, including being a customer through &lt;a href="http://www.vaasnet.com"&gt;Vaasnet&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;So much has changed in this time. Ten years ago I began working for OrcsWeb from Canada. Nine years ago I moved my family down here to North Carolina and assumed the role of Director of Technology.&amp;#160; I was able to be a part of the company as it grew in staff, servers, customers, and reputation. I feel honored to be a part of OrcsWeb during these exciting years.&lt;/p&gt;  &lt;p&gt;During my time at OrcsWeb I have been given opportunities to attend conferences, meet and become friends with top technical experts in the field, write articles, co-author two books, and speak at conferences and code camps. It was through OrcsWeb that I was given opportunities to be active in the community, to become a Microsoft MVP and an ASPInsider.&lt;/p&gt;  &lt;p&gt;I’m grateful to Brad and Karla Kingsley who have always treated me like more than an employee. They have always encouraged me to grow and to pursue my dreams.&lt;/p&gt;  &lt;p&gt;I’m thankful to Jeff Graves who has been accommodating to my evolving schedule and less than full time availability.&amp;#160; And in terms of technical smarts, Jeff tops the list!&amp;#160; And I’m also thankful of the rest of the team at OrcsWeb who are experts in the field, and with whom it’s always been a privilege to work.&lt;/p&gt;  &lt;p&gt;Moving forward, I have two main focuses. I’ll be able to spend more time on &lt;a href="http://www.vaasnet.com"&gt;Vaasnet&lt;/a&gt; (a company I co-founded with &lt;a href="http://weblogs.asp.net/jeffwids/"&gt;Jeff Widmer&lt;/a&gt;) to see the company position itself further in the market and to strengthen both the product and the brand.&amp;#160; Additionally, I’m working in a part time basis with &lt;a href="http://www.dynamicwebcms.com/"&gt;Dynamicweb&lt;/a&gt; an established CMS and eCommerce company in Europe who is just moving into the US market. Dynamicweb has a strong product already and I’m excited to work with the leadership team in the US. Expect to see more of Dynamicweb in the coming months and years.&lt;/p&gt;  &lt;p&gt;I just want to reiterate a big thanks to OrcsWeb for helping write such an important chapter in my life. And it’s with excitement that I look forward to the next chapter of my life.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8501810" width="1" height="1"&gt;</content><author><name>OWScott</name><uri>http://weblogs.asp.net/members/OWScott.aspx</uri></author></entry><entry><title>Introducing Testing Domain - localtest.me</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/owscott/archive/2012/05/14/introducing-testing-domain-localtest-me.aspx" /><id>http://weblogs.asp.net/owscott/archive/2012/05/14/introducing-testing-domain-localtest-me.aspx</id><published>2012-05-14T15:59:54Z</published><updated>2012-05-14T15:59:54Z</updated><content type="html">&lt;p&gt;Save this URL, memorize it, write it on a sticky note, tweet it, tell your colleagues about it!&amp;#160; &lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="4"&gt;&lt;font color="#c0504d"&gt;localtest.me&lt;/font&gt; (&lt;/font&gt;&lt;a href="http://localtest.me"&gt;&lt;font size="4"&gt;http://localtest.me&lt;/font&gt;&lt;/a&gt;&lt;font size="4"&gt;)&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;and&lt;/p&gt;  &lt;p&gt;&lt;font size="4"&gt;&lt;font color="#c0504d"&gt;*.localtest.me&lt;/font&gt; (&lt;/font&gt;&lt;a href="http://something.localtest.me"&gt;&lt;font size="4"&gt;http://something.localtest.me&lt;/font&gt;&lt;/a&gt;&lt;font size="4"&gt;)&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;If you do any testing on your local system you’ve probably created &lt;em&gt;hosts &lt;/em&gt;file entries (c:\windows\system32\drivers\etc\hosts) for different testing domains and had them point back to 127.0.0.1.&amp;#160; This works great but it requires just a bit of extra effort. &lt;/p&gt;  &lt;p&gt;This localtest.me trick is so obvious, so simple, and yet so powerful.&amp;#160; I wouldn’t be surprised if there are other domain names like this out there, but I haven’t run across them yet so I just ordered the domain name &lt;em&gt;localtest.me&lt;/em&gt; which I’ll keep available for the internet community to use. &lt;/p&gt;  &lt;p&gt;Here’s how it works. The entire domain name localtest.me—and all wildcard entries—point to 127.0.0.1.&amp;#160; So without any changes to your host file you can immediate start testing with a local URL.&lt;/p&gt;  &lt;p&gt;Examples:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://localtest.me"&gt;http://localtest.me&lt;/a&gt;     &lt;br /&gt;&lt;a href="http://newyork.localtest.me"&gt;http://newyork.localtest.me&lt;/a&gt;     &lt;br /&gt;&lt;a href="http://mysite.localtest.me"&gt;http://mysite.localtest.me&lt;/a&gt;    &lt;br /&gt;&lt;a href="http://redirecttest.localtest.me"&gt;http://redirecttest.localtest.me&lt;/a&gt;     &lt;br /&gt;&lt;a href="http://sub1.sub2.sub3.localtest.me"&gt;http://sub1.sub2.sub3.localtest.me&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;You name it, just use any *.localtest.me URL that you dream up and it will work for testing on your local system.&lt;/p&gt;  &lt;p&gt;This was inspired by a trick that &lt;a href="http://imar.spaanjaars.com/"&gt;Imar Spaanjaars&lt;/a&gt; introduced me to. He created a loopback wildcard URL with his company domain name.&amp;#160; I took this one step further and ordered a domain name just for this purpose.&lt;/p&gt;  &lt;p&gt;I would have liked to order localhost.com or localhost.me but those domain names were taken. So to help you remember, just remember that it’s ‘local&lt;strong&gt;test&lt;/strong&gt;’ and not ‘localhost’, and it’s ‘.me’ rather than ‘.com’.&lt;/p&gt;  &lt;p&gt;I can’t track usage since the domain name resolves to 127.0.0.1 and never passes through my servers, so this is just a public tool which I’ll give to the community. I hope it gets used. And, since I can’t really use the domain name to explain itself, please spread the word and tell others about it.&lt;/p&gt;  &lt;p&gt;Some examples on how to use it would include:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Creating websites on your dev machine.&amp;#160; site1.localtest.me, site2.localtest.me, site3.localtest.me.&lt;/li&gt;    &lt;li&gt;Great for URL Rewrite (IIS) or mod_rewrite (Apache) testing: redirect.localtest.me, failuretest.localtest.me, subdomain.localtest.me, city1.localtest.me.&lt;/li&gt;    &lt;li&gt;Any testing on your local system where a friendly URL would be useful.&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;I hope you enjoy!&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8477060" width="1" height="1"&gt;</content><author><name>OWScott</name><uri>http://weblogs.asp.net/members/OWScott.aspx</uri></author><category term="IIS" scheme="http://weblogs.asp.net/owscott/archive/tags/IIS/default.aspx" /><category term="IIS7" scheme="http://weblogs.asp.net/owscott/archive/tags/IIS7/default.aspx" /><category term="Windows Server" scheme="http://weblogs.asp.net/owscott/archive/tags/Windows+Server/default.aspx" /><category term="Windows 7" scheme="http://weblogs.asp.net/owscott/archive/tags/Windows+7/default.aspx" /><category term="Troubleshooting" scheme="http://weblogs.asp.net/owscott/archive/tags/Troubleshooting/default.aspx" /><category term="IIS8" scheme="http://weblogs.asp.net/owscott/archive/tags/IIS8/default.aspx" /></entry><entry><title>Google and Geo-location, CNDs, DNS Load Balancing-Week 50</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/owscott/archive/2012/04/19/google-and-geo-location-cnds-dns-load-balancing-week-50.aspx" /><id>http://weblogs.asp.net/owscott/archive/2012/04/19/google-and-geo-location-cnds-dns-load-balancing-week-50.aspx</id><published>2012-04-20T01:24:18Z</published><updated>2012-04-20T01:24:18Z</updated><content type="html">&lt;p&gt;You can find this week’s &lt;a href="http://dotnetslackers.com/articles/iis/Q-A-DNS-Load-Balancing-Google-and-Geo-location-CDNs-Week-50.aspx"&gt;video here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;This week answers two Q&amp;amp;A questions from viewers. DNS Load Balancing and then some discussion and a walkthrough using Application Request Routing (ARR) for a Content Delivery Network (CDN).&lt;/p&gt;  &lt;p&gt;There’s a growing movement towards Content Delivery Networks (CDN); fronting web farms and geographically dispersing websites. This week I continue with Q&amp;amp;A’s from viewers, taking questions on DNS Load Balancing and CDNs.&lt;/p&gt;  &lt;h5&gt;Question 1:&lt;/h5&gt;  &lt;p&gt;I would love to see some clever DNS load balancing (not sure what capability windows is offering). Flesik&lt;/p&gt;  &lt;h5&gt;Question 2a:&lt;/h5&gt;  &lt;p&gt;I would love to see an end-2-end CDN redundant network setup (dns balancing, ARR nodes, parent notes etc). Flesik&lt;/p&gt;  &lt;h5&gt;Question 2b:&lt;/h5&gt;  &lt;p&gt;I would be interested in seeing a series on building an ecdn or ecn using ARR and what the best practices would be to scale it out geographically.&lt;/p&gt;  &lt;p&gt;It seems ARR is sold that way... really not sold but talked about. I have tried to put my theory out and try it but i just don't know the best way to route my clients to their designated locations. Can you help out with an awesome weblog maybe? Adam&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;The following URL is the one I mentioned in the video: &lt;a href="http://learn.iis.net/page.aspx/649/deploying-application-request-routing-in-cdn"&gt;http://learn.iis.net/page.aspx/649/deploying-application-request-routing-in-cdn&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;In this week’s video we look at DNS load balancing and geo-location issues that Google faces by using DNS to determine a user’s location. We also take a look at using Microsoft Application Request Routing (ARR) to create a CDN.&lt;/p&gt;  &lt;p&gt;This is week 50 of a 52 week series for the web pro. You can view past and future weeks here: &lt;a href="http://dotnetslackers.com/projects/LearnIIS7/"&gt;http://dotnetslackers.com/projects/LearnIIS7/&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;You can find this week’s &lt;a href="http://dotnetslackers.com/articles/iis/Q-A-DNS-Load-Balancing-Google-and-Geo-location-CDNs-Week-50.aspx"&gt;video here&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8397777" width="1" height="1"&gt;</content><author><name>OWScott</name><uri>http://weblogs.asp.net/members/OWScott.aspx</uri></author><category term="IIS" scheme="http://weblogs.asp.net/owscott/archive/tags/IIS/default.aspx" /><category term="IIS7" scheme="http://weblogs.asp.net/owscott/archive/tags/IIS7/default.aspx" /><category term="ARR" scheme="http://weblogs.asp.net/owscott/archive/tags/ARR/default.aspx" /><category term="Web Pro Series" scheme="http://weblogs.asp.net/owscott/archive/tags/Web+Pro+Series/default.aspx" /><category term="DNS" scheme="http://weblogs.asp.net/owscott/archive/tags/DNS/default.aspx" /></entry><entry><title>What’s new in IIS8, Perf, Indexing Service-Week 49</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/owscott/archive/2012/03/27/what-s-new-in-iis8-perf-indexing-service-week-49.aspx" /><id>http://weblogs.asp.net/owscott/archive/2012/03/27/what-s-new-in-iis8-perf-indexing-service-week-49.aspx</id><published>2012-03-27T13:37:08Z</published><updated>2012-03-27T13:37:08Z</updated><content type="html">&lt;p&gt;You can find this week’s &lt;a href="http://dotnetslackers.com/articles/iis/QuestionAndAnswers-Whats-new-in-IIS8-Perf-Indexing-Service-Week-49.aspx"&gt;video here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;This week I'm taking Q&amp;amp;A from viewers, starting with what's new in IIS8, a question on &lt;em&gt;enable32BitAppOnWin64&lt;/em&gt;, performance settings for asp.net, the ARR Helper, and Indexing Services.&lt;/p&gt;  &lt;p&gt;This week we look at five topics.&lt;/p&gt;  &lt;h5&gt;Pre-topic:&lt;/h5&gt; We take a look at the new features in IIS8. Last week Internet Information Services (IIS) 8 Beta was released to the public. This week's video touches on the upcoming features in the next version of IIS. Here’s a &lt;a href="http://weblogs.asp.net/owscott/archive/2012/03/01/what-s-new-in-iis-8.aspx"&gt;link to the blog post&lt;/a&gt; which was mentioned in the video   &lt;h5&gt;Question 1:&lt;/h5&gt;  &lt;p&gt;In a number of places (&lt;a href="http://learn.iis.net/page.aspx/201/32-bit-mode-worker-processes/"&gt;http://learn.iis.net/page.aspx/201/32-bit-mode-worker-processes/&lt;/a&gt;, &lt;a href="http://channel9.msdn.com/Events/MIX/MIX08/T06"&gt;http://channel9.msdn.com/Events/MIX/MIX08/T06&lt;/a&gt;), I've saw that &lt;em&gt;enable32BitAppOnWin64&lt;/em&gt; is recommended for performance reasons. I'm guessing it has to do with memory usage... but I never could find detailed explanation on why this is recommended (even Microsoft books are vague on this topic - they just say - do it, but provide no reason why it should be done). Do you have any insight into this? (Predrag Tomasevic)&lt;/p&gt;  &lt;h5&gt;Question 2:&lt;/h5&gt;  &lt;p&gt;Do you have any recommendations on modifying aspnet.config and machine.config to deliver better performance when it comes to &amp;quot;high number of concurrent connections&amp;quot;? I've implemented recommendations for modifying machine.config from this article (&lt;a href="http://www.codeproject.com/KB/aspnet/10ASPNetPerformance.aspx"&gt;http://www.codeproject.com/KB/aspnet/10ASPNetPerformance.aspx&lt;/a&gt; - ASP.NET Process Configuration Optimization section)... but I would gladly listen to more recommendations if you have them. (Predrag Tomasevic)&lt;/p&gt;  &lt;h5&gt;Question 3:&lt;/h5&gt;  &lt;p&gt;Could you share more of your experience with ARR Helper? I'm specifically interested in configuring ARR Helper (for example - how to only accept only X-Forwards-For from certain IPs (proxies you trust)). (Predrag Tomasevic)&lt;/p&gt;  &lt;h5&gt;Question 4:&lt;/h5&gt;  &lt;p&gt;What is the replacement for indexing service to use in coding web search pages on a Windows 2008R2 server? (Susan Williams)&lt;/p&gt;  &lt;p&gt;Here’s the link that was mentioned: &lt;a href="http://technet.microsoft.com/en-us/library/ee692804.aspx"&gt;http://technet.microsoft.com/en-us/library/ee692804.aspx&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;This is now week 49 of a 52 week series for the web pro. You can view past and future weeks here: &lt;a href="http://dotnetslackers.com/projects/LearnIIS7/"&gt;http://dotnetslackers.com/projects/LearnIIS7/&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;You can find this week’s &lt;a href="http://dotnetslackers.com/articles/iis/QuestionAndAnswers-Whats-new-in-IIS8-Perf-Indexing-Service-Week-49.aspx"&gt;video here&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8366101" width="1" height="1"&gt;</content><author><name>OWScott</name><uri>http://weblogs.asp.net/members/OWScott.aspx</uri></author><category term="IIS" scheme="http://weblogs.asp.net/owscott/archive/tags/IIS/default.aspx" /><category term="Performance Tuning" scheme="http://weblogs.asp.net/owscott/archive/tags/Performance+Tuning/default.aspx" /><category term="Web Pro Series" scheme="http://weblogs.asp.net/owscott/archive/tags/Web+Pro+Series/default.aspx" /><category term="Windows Server 8" scheme="http://weblogs.asp.net/owscott/archive/tags/Windows+Server+8/default.aspx" /><category term="IIS8" scheme="http://weblogs.asp.net/owscott/archive/tags/IIS8/default.aspx" /></entry><entry><title>What’s New in IIS 8</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/owscott/archive/2012/03/01/what-s-new-in-iis-8.aspx" /><id>http://weblogs.asp.net/owscott/archive/2012/03/01/what-s-new-in-iis-8.aspx</id><published>2012-03-01T20:07:00Z</published><updated>2012-03-01T20:07:00Z</updated><content type="html">&lt;p&gt;With the &lt;a href="http://www.microsoft.com/en-us/server-cloud/windows-server/v8-default.aspx" target="_blank" mce_href="http://www.microsoft.com/en-us/server-cloud/windows-server/v8-default.aspx"&gt;beta release&lt;/a&gt; of Windows Server 8 today, Internet Information server (IIS) 8 is available to the public for testing and even production workload testing.&amp;nbsp; Many system administrators have been anxious to kick the tires and to find out which features are coming.&lt;/p&gt;  &lt;p&gt;I’ll include a high level overview of what we will see in the upcoming version of IIS.&amp;nbsp; The focus with this release of IIS 8 is on the large scale hoster.&amp;nbsp; There are substantial performance improvements to handle thousands of sites on a single server farm—with ease.&amp;nbsp; Everything that I mention below is available for &lt;a href="http://www.microsoft.com/en-us/server-cloud/windows-server/v8-default.aspx" target="_blank" mce_href="http://www.microsoft.com/en-us/server-cloud/windows-server/v8-default.aspx"&gt;download&lt;/a&gt; and usage today. &lt;/p&gt;  &lt;p&gt;Forgive me if there are typos.&amp;nbsp; I’m writing this while at the MVP Summit in Seattle while trying to listen to another session at the same time.&amp;nbsp; Thanks to the IIS team who gave detailed demos on this yesterday and gave me permission to talk about this.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Real CPU Throttling &lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Previous versions of IIS have CPU throttling but it doesn’t do what most of us want.&amp;nbsp; When a site reaches the CPU threshold the site is turned off for a period of time before it is allowed to run again.&amp;nbsp; This protects the other sites on the server but it isn’t a welcome action for the site in question since the site breaks rather than just slowing down.&amp;nbsp; &lt;/p&gt;  &lt;p&gt;Finally in version IIS 8 there are kernel level changes to support real CPU Throttling.&amp;nbsp; Now there are two new actions for sites that reach the CPU threshold.&amp;nbsp; They are &lt;em&gt;Throttle&lt;/em&gt; and &lt;em&gt;Throttle under load&lt;/em&gt;.&amp;nbsp; If you used &lt;a href="http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;amp;id=8120" target="_blank" mce_href="http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;amp;id=8120"&gt;WSRM&lt;/a&gt; to achieve this in the past, you no longer need to do so, and the functionality is improved over what is available with WSRM.&lt;/p&gt;  &lt;p&gt;The &lt;em&gt;throttle&lt;/em&gt; feature will keep the CPU for a particular worker process at the level specified.&amp;nbsp; Throttling isn’t applied to just the primary worker process, but it also includes all child processes, if they happen to exist. &lt;/p&gt;  &lt;p&gt;The &lt;em&gt;Throttle under load&lt;/em&gt; feature will allow a site to use all possible CPU if it’s available while throttling the worker process if the server is under load.&lt;/p&gt;  &lt;p&gt;The throttling is based on the user and not specifically on the application pool. This means that if you use dedicated users on more than one app pool then it throttles for all of app pools sharing the same user identity. Note that the application pool identity user is unique so if you use the app pool identity user—which is common—then each app pool will be throttled individually.&lt;/p&gt;  &lt;p&gt;This is a welcome new feature and is nicely implemented.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;SSL Scalability&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Unless you deal with large scale site hosting with many SSL certificates you may not have realized that there is room for improvement in this area.&amp;nbsp; &lt;/p&gt;  &lt;p&gt;Previous versions of IIS have limited secure site density.&amp;nbsp; Each SSL site requires its own IP address and after adding a few SSL sites, startup performance becomes slow and the memory demand is high.&amp;nbsp; Every certificate is loaded into memory on the first visit to an SSL site which creates a large memory footprint and a long delay on the first load.&amp;nbsp; &lt;/p&gt;  &lt;p&gt;In IIS 8 the SSL certificate count is easily scalable to thousands of secure sites per machine with almost instantaneous first-loads.&amp;nbsp; Only the certificate that is needed is loaded and it will unload after a configurable idle period.&amp;nbsp; Additionally, enumerating or loading huge numbers of certificates is substantially improved.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;SNI / SSL Host Header Support&lt;/strong&gt; &lt;/p&gt;  &lt;p&gt;Using host headers and a shared IP address with SSL certificate has &lt;a href="http://weblogs.asp.net/owscott/archive/2011/02/05/the-ssl-bindings-issue-web-pro-week-6-of-52.aspx" target="_blank" mce_href="http://weblogs.asp.net/owscott/archive/2011/02/05/the-ssl-bindings-issue-web-pro-week-6-of-52.aspx"&gt;always been problematic&lt;/a&gt;.&amp;nbsp; IIS 8 now offers Server Name Indication (SNI) support which allows many SSL sites to share the same IP.&amp;nbsp; SNI is a fairly new feature (within the last few years) which allows host headers to work with SSL. It does&amp;nbsp;this by carrying the target host name in the TLS handshake rather than the encrypted part of the packet.&lt;/p&gt;  &lt;p&gt;IIS 8 makes SNI support a first class citizen in the site bindings. &lt;/p&gt;  &lt;p&gt;Note that SNI doesn't work on all browsers. For example, Internet Explorer&amp;nbsp;in Windows XP&amp;nbsp;does not support SNI.&amp;nbsp; Read more about that from Eric Law's &lt;a href="http://blogs.msdn.com/b/ieinternals/archive/2009/12/07/certificate-name-mismatch-warnings-and-server-name-indication.aspx" target="_blank" mce_href="http://blogs.msdn.com/b/ieinternals/archive/2009/12/07/certificate-name-mismatch-warnings-and-server-name-indication.aspx"&gt;blog post&lt;/a&gt;. Over 85% of browsers is use today support SNI, but since it's not 100%, it will not work universally.&amp;nbsp;However, like the adoption issue with host headers in the '90s, it will a fully supported before we know it. More details with a list of browsers can be found here: &lt;a href="http://en.wikipedia.org/wiki/Server_Name_Indication" mce_href="http://en.wikipedia.org/wiki/Server_Name_Indication"&gt;http://en.wikipedia.org/wiki/Server_Name_Indication&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;This sets the stage for sharing IP addresses which is extra important as ipv4 IPs become more valuable and consolidation of IPs becomes the trend.&amp;nbsp; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;SSL Manageability - Central Certificate Store (CCS)&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;In IIS 7 managing SSL is labor intensive, particularly for server farms.&amp;nbsp; All certificate must be imported on every machine in the farm.&amp;nbsp; When setting up new servers you must account for time needed to import certificates when scaling out, and even on small server farms.&amp;nbsp; In previous versions keeping certificates in sync between servers is difficult to manage and often requires manual steps.&lt;/p&gt;  &lt;p&gt;In IIS8 there is a new Central Certificate Store (CCS).&amp;nbsp; Central Certificate Store allows storing certificates on a central file share instead of each machine.&amp;nbsp; You can point the servers to a single network share, or use replication like DFS-R to sync the folders between machines.&lt;/p&gt;  &lt;p&gt;Renewal and syncing is as simple as xcopying pfx files to the location that you specify when enabling CCS on the web server.&amp;nbsp; Enabling CCS is straight forward too.&amp;nbsp; It works very similar to enabling Shared Configuration.&lt;/p&gt;  &lt;p&gt;CCS compliments the SNI functionality to support sites with multiple certs and a single IP.&lt;/p&gt;  &lt;p&gt;The mapping of bindings to certificates uses a bit of magic … by convention rather than configuration. This is important for extremely large lists of certificates. Now you don't need to select them from a huge list. The value of the host header needs to match the name of the cert. Your CCS folder will have many .pfx files with names that match the domain name.&amp;nbsp; Basically the name of the .pfx files in the certificate store is the primary key.&lt;/p&gt;  &lt;p&gt;If you use a wildcard cert then it needs to be named _.domain.com.pfx.&lt;/p&gt;  &lt;p&gt;As you would assume, there is support for Multiple Domain Certificates (Unified Communications Certificate [UCC]). If you use multiple domain certificates using the subjectAltName feature of the certificate then you just create multiple copies of the pfx, one for each subjectAltName.&lt;/p&gt;  &lt;p&gt;Note that you can use the old method which binds to by certificate identifier and it works the same as it did in the past. &lt;/p&gt;  &lt;p&gt;Furthermore there is a neat feature for the central repository that allows grouping by expiration date, which groups by "Today / This Week / Next Week / Next Month / Later" which is handy for seeing which certificates are ready to expire.&lt;/p&gt;  &lt;p&gt;With these changes to the certificates, it makes for a powerful solution for large scale webfarm hosting with multiple tenants.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Dynamic IP Restrictions&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Information about this is already available on the web, but it's moving along and getting closer for the final release.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;FTP Logon Restriction&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Yay. A new FTP IP Restrictions module is coming! This is similar in concept to Dynamic IP Restrictions for HTTP. One of the key differences is that it does gray listing rather than black listing. When someone is blocked, they are only blocked for the sample period (e.g. 30 seconds). This is nice because it's enough to thwart or slow brute force and common name password attacks, but legit invalid attempts can continue to attempt to log in without waiting for long periods of time.&lt;/p&gt;  &lt;p&gt;What's extra nice about having this feature is that you can set it slightly more sensitive than your domain username lockout policy so that brute force attacks don't cause your username to be locked out from too many invalid attempts. The FTP IP Restrictions can throttle the hack attempts without locking out your domain users.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Application Initialization Module&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Previously known as the application warm-up module which was pulled for a time, now it's ready in full force as Application Initialization Module.&lt;/p&gt;  &lt;p&gt;This allows spinning up sites and pages before traffic arrives and handling of requests in a friendly way while the application first loads. It's not uncommon for a site to take a minute or longer on the first load (yes SharePoint admins, we feel your pain).&amp;nbsp; This allows you to protect the end user from being the person that triggers this.&lt;/p&gt;  &lt;p&gt;It's possible to set a warm-up page at the server level as a single setting, or you can use powerful URL Rewrite rules for more flexibility.&lt;/p&gt;  &lt;p&gt;You can also ensure that your load balancer’s health test page doesn’t serve up a valid response until the site is fully initialized according to your preferences.&amp;nbsp; Then the load balancer will bring a node into rotation only after the entire warm-up has completed.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Configuration Scale&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;The IIS configuration files (e.g. applicationHost.config) can handle very large files with ease now.&amp;nbsp; There are substantial performance improvements in the upcoming version. Only administrators with large numbers of sites on the same server or server farm (think thousands) would have noticed before, but for large scale performance the new changes are paving the way for huge scale.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Web Sockets&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;It’s important to include Web Sockets in this list too.&amp;nbsp; Apart from some brief information I really haven’t looked into Web Sockets in detail yet so I’ll just &lt;a href="http://www.paulbatum.com/2011/09/getting-started-with-websockets-in.html" target="_blank" mce_href="http://www.paulbatum.com/2011/09/getting-started-with-websockets-in.html"&gt;include a great link&lt;/a&gt; from Paul Batum on it.&amp;nbsp; Web Sockets does require Windows 8 or later on the server side.&amp;nbsp; &lt;/p&gt;  &lt;p&gt;All in all these are welcome changes.&amp;nbsp; While previous versions of IIS already did a great job of handling massive amounts of traffic, IIS 8 now can handle thousands (or tens of thousands) of sites and their extensive configurations on a single server farm.&amp;nbsp; With HTTP and FTP logon restrictions, CPU throttling, the Application Initialization Module, and large scale SSL and configuration improvements, IIS 8 brings a number of welcome improvements.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8321193" width="1" height="1"&gt;</content><author><name>OWScott</name><uri>http://weblogs.asp.net/members/OWScott.aspx</uri></author><category term="IIS" scheme="http://weblogs.asp.net/owscott/archive/tags/IIS/default.aspx" /><category term="Windows Server" scheme="http://weblogs.asp.net/owscott/archive/tags/Windows+Server/default.aspx" /><category term="Windows Server 8" scheme="http://weblogs.asp.net/owscott/archive/tags/Windows+Server+8/default.aspx" /><category term="IIS8" scheme="http://weblogs.asp.net/owscott/archive/tags/IIS8/default.aspx" /></entry><entry><title>IIS FTP Troubleshooting-Week 48</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/owscott/archive/2012/02/21/iis-ftp-troubleshooting-week-48.aspx" /><id>http://weblogs.asp.net/owscott/archive/2012/02/21/iis-ftp-troubleshooting-week-48.aspx</id><published>2012-02-21T15:58:57Z</published><updated>2012-02-21T15:58:57Z</updated><content type="html">&lt;p&gt;You can find this week’s &lt;a href="http://dotnetslackers.com/articles/iis/IIS-FTP-Troubleshooting-Week-48.aspx"&gt;video here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;This lesson covers ways to troubleshoot IIS FTP. When it works, it works well, but if you run into issues getting an FTP account working it can sometimes be difficult to resolve. This video will help you understand some helpful tricks and it will walk you through ways to isolate and resolve the issue. &lt;/p&gt;  &lt;p&gt;Over the last five weeks we’ve been looking at IIS FTP. See the list below to jump to a specific FTP topic.&amp;#160; This week we explore some troubleshooting techniques and review the following FTP connectivity stack.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;DNS Resolution/Network Connectivity&lt;/li&gt;    &lt;li&gt;Firewall Access (Passive/Active / Secure?) &lt;/li&gt;    &lt;li&gt;IIS Bindings &lt;/li&gt;    &lt;li&gt;Authentication &lt;/li&gt;    &lt;li&gt;Authorization &lt;/li&gt;    &lt;li&gt;Isolation Mode / File paths&lt;/li&gt;    &lt;li&gt;NTFS Permissions&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;There were two external resources which I referenced. They are:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Flushing the IIS FTP logs to disk &lt;a href="http://weblogs.asp.net/owscott/archive/2012/02/03/flush-http-and-ftp-logs-in-iis.aspx"&gt;http://weblogs.asp.net/owscott/archive/2012/02/03/flush-http-and-ftp-logs-in-iis.aspx&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;One of the more advanced steps is to use Event Tracing. Here is the link I referred to.&lt;a href="http://blogs.msdn.com/b/robert_mcmurray/archive/2008/08/29/ftp-and-etw-tracing.aspx"&gt;http://blogs.msdn.com/b/robert_mcmurray/archive/2008/08/29/ftp-and-etw-tracing.aspx&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;This is now week 48 of a 52 week series for the web pro and it is the final of a 5-week mini-series on IIS FTP. The five weeks include:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Week 1: &lt;a href="http://dotnetslackers.com/articles/iis/IIS-FTP-Basics-Week-44.aspx"&gt;IIS FTP Basics&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;Week 2: &lt;a href="http://dotnetslackers.com/articles/iis/IIS-FTP-and-IIS-Manager-Users-Week-45.aspx"&gt;IIS FTP and IIS Manager Users&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;Week 3: &lt;a href="http://dotnetslackers.com/articles/iis/IIS-FTP-User-Isolation-Week-46.aspx"&gt;IIS FTP and User Isolation&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;Week 4: &lt;a href="http://dotnetslackers.com/articles/iis/FTP-Firewall-settings-Active-vs-Passive-and-FTPS-Explicit-vs-Implicit-Week-47.aspx"&gt;IIS FTP Firewall settings, Active vs. Passive&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;Week 5: &lt;a href="http://dotnetslackers.com/articles/iis/IIS-FTP-Troubleshooting-Week-48.aspx"&gt;IIS FTP Troubleshooting&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;You can find this week’s &lt;a href="http://dotnetslackers.com/articles/iis/IIS-FTP-Troubleshooting-Week-48.aspx"&gt;video here&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8303523" width="1" height="1"&gt;</content><author><name>OWScott</name><uri>http://weblogs.asp.net/members/OWScott.aspx</uri></author><category term="IIS" scheme="http://weblogs.asp.net/owscott/archive/tags/IIS/default.aspx" /><category term="FTP" scheme="http://weblogs.asp.net/owscott/archive/tags/FTP/default.aspx" /><category term="IIS7" scheme="http://weblogs.asp.net/owscott/archive/tags/IIS7/default.aspx" /><category term="Web Pro Series" scheme="http://weblogs.asp.net/owscott/archive/tags/Web+Pro+Series/default.aspx" /></entry><entry><title>FTP Firewall Settings, Active vs. Passive, and FTPS Explicit vs. Implicit-Week 47</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/owscott/archive/2012/02/13/ftp-firewall-settings-active-vs-passive-and-ftps-explicit-vs-implicit-week-47.aspx" /><id>http://weblogs.asp.net/owscott/archive/2012/02/13/ftp-firewall-settings-active-vs-passive-and-ftps-explicit-vs-implicit-week-47.aspx</id><published>2012-02-13T14:28:48Z</published><updated>2012-02-13T14:28:48Z</updated><content type="html">&lt;p&gt;You can find this week’s &lt;a href="http://dotnetslackers.com/articles/iis/FTP-Firewall-settings-Active-vs-Passive-and-FTPS-Explicit-vs-Implicit-Week-47.aspx"&gt;video here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Have you ever wondered what FTP Active mode or Passive mode means? Do you have a good understanding of the FTP data channel or control channel? It can be difficult to fully understand FTP, which firewall ports to enable, and how to navigate the two communication channels. This lesson will hopefully clear up these questions and more.&lt;/p&gt;  &lt;p&gt;This week’s video lesson takes a deep dive into FTP Active vs. Passive modes. As part of this you’ll get a chance to see the various modes in action, see what the traffic looks like in Wireshark, see exact firewall rules, learn about stateful FTP, find out about Explicit FTPS and Implicit FTPS, and learn about the FTP data channel and control channels.&lt;/p&gt;  &lt;p&gt;This week's video lesson is the 4th of a 5-week mini-series on IIS FTP. The five weeks include:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://weblogs.asp.net/owscott/archive/2011/12/13/iis-ftp-basics-week-44.aspx"&gt;Week 1&lt;/a&gt;: IIS FTP Basics &lt;/li&gt;    &lt;li&gt;&lt;a href="http://weblogs.asp.net/owscott/archive/2012/01/04/iis-ftp-and-iis-manager-users-week-45.aspx"&gt;Week 2&lt;/a&gt;: IIS FTP and IIS Manager Users &lt;/li&gt;    &lt;li&gt;&lt;a href="http://weblogs.asp.net/owscott/archive/2012/01/23/iis-ftp-user-isolation-week-46.aspx"&gt;Week 3&lt;/a&gt;: IIS FTP and User Isolation &lt;/li&gt;    &lt;li&gt;&lt;a href="http://weblogs.asp.net/owscott/archive/2012/02/13/ftp-firewall-settings-active-vs-passive-and-ftps-explicit-vs-implicit-week-47.aspx"&gt;Week 4&lt;/a&gt;: IIS FTP Firewall settings, Active vs. Passive &lt;/li&gt;    &lt;li&gt;Week 5: IIS FTP Troubleshooting plus FTP Host Headers&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;This is now week 47 of a 52 week series for the web pro, and the 4th of a 5 week mini-series on IIS FTP. You can view past and future weeks here: &lt;a href="http://dotnetslackers.com/projects/LearnIIS7/"&gt;http://dotnetslackers.com/projects/LearnIIS7/&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;You can find this week’s &lt;a href="http://dotnetslackers.com/articles/iis/FTP-Firewall-settings-Active-vs-Passive-and-FTPS-Explicit-vs-Implicit-Week-47.aspx"&gt;video here&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8295466" width="1" height="1"&gt;</content><author><name>OWScott</name><uri>http://weblogs.asp.net/members/OWScott.aspx</uri></author><category term="IIS" scheme="http://weblogs.asp.net/owscott/archive/tags/IIS/default.aspx" /><category term="FTP" scheme="http://weblogs.asp.net/owscott/archive/tags/FTP/default.aspx" /><category term="IIS7" scheme="http://weblogs.asp.net/owscott/archive/tags/IIS7/default.aspx" /><category term="Web Pro Series" scheme="http://weblogs.asp.net/owscott/archive/tags/Web+Pro+Series/default.aspx" /></entry><entry><title>Flush IIS HTTP and FTP Logs to Disk</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/owscott/archive/2012/02/03/flush-http-and-ftp-logs-in-iis.aspx" /><id>http://weblogs.asp.net/owscott/archive/2012/02/03/flush-http-and-ftp-logs-in-iis.aspx</id><published>2012-02-04T04:11:13Z</published><updated>2012-02-04T04:11:13Z</updated><content type="html">&lt;p&gt;Today I wanted to find a way to flush the IIS FTP logs on-demand.&amp;#160; The logs for IIS FTP flush to disk every 6 minutes, and the HTTP logs every 1 minute (or 64kb).&amp;#160; This can make troubleshooting difficult when you don’t receive immediate access to the latest log data.&lt;/p&gt;  &lt;p&gt;After looking everywhere I could think of, from search engine searches to perusing through the &lt;a href="http://dotnetslackers.com/articles/iis/Mastering-IIS-Understanding-the-Schema-Week-19.aspx" target="_blank"&gt;IIS schema files&lt;/a&gt;, I figured I had better go to the source and ask &lt;a href="http://blogs.msdn.com/b/robert_mcmurray" target="_blank"&gt;Robert McMurray&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Sure enough, Robert had the answer and even &lt;a href="http://blogs.msdn.com/b/robert_mcmurray/archive/2012/02/03/programmatically-flushing-ftp-logs.aspx" target="_blank"&gt;wrote a blog post&lt;/a&gt; in response to my question with code examples for four scripting/programming languages (C#, VB.NET, JavaScript, VbScript).&lt;/p&gt;  &lt;p&gt;There is not a netsh or appcmd solution though, so the scripting or programming options are the way to do it.&amp;#160; Actually, you can also flush the logs by restarting the Microsoft FTP Service (ftpsvc) but, as you would assume, it will impact currently active FTP sessions.&lt;/p&gt;  &lt;p&gt;This blog post serves three purposes.&amp;#160; &lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;It’s a reference pointing to Robert’s examples &lt;/li&gt;    &lt;li&gt;I’ll include how to do the same for the HTTP logs &lt;/li&gt;    &lt;li&gt;I’ll provide a PowerShell example which I based on Robert’s examples &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;1. The reference is mentioned above already, but to give me something useful to write in this paragraph, I’ll include it again. &lt;a href="http://blogs.msdn.com/b/robert_mcmurray/archive/2012/02/03/programmatically-flushing-ftp-logs.aspx" target="_blank"&gt;Programmatically Flushing FTP Logs&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;2. For HTTP there is a method to flush the logs using netsh.&lt;/p&gt;  &lt;pre class="csharpcode"&gt;netsh http flush logbuffer&lt;/pre&gt;
&lt;style type="text/css"&gt;


.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;This will immediately flush the HTTP logs for all sites.&lt;/p&gt;

&lt;p&gt;3. The FTP logs can be done from PowerShell too.&amp;#160; Here’s a script which is the PowerShell equivalent of Robert’s examples.&amp;#160; Just update $siteName, or pass it as a parameter to the script.&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;Param($siteName = &lt;span style="color: #006080"&gt;&amp;quot;Default Web Site&amp;quot;&lt;/span&gt;) &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #008000"&gt;#Get MWA ServerManager&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;[System.Reflection.Assembly]::LoadFrom( &lt;span style="color: #006080"&gt;&amp;quot;C:\windows\system32\inetsrv\Microsoft.Web.Administration.dll&amp;quot;&lt;/span&gt; ) | Out-Null&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;$serverManager = new-object Microsoft.Web.Administration.ServerManager &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;$config = $serverManager.GetApplicationHostConfiguration()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #008000"&gt;#Get Sites Collection&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;$sitesSection = $config.GetSection(&lt;span style="color: #006080"&gt;&amp;quot;system.applicationHost/sites&amp;quot;&lt;/span&gt;)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;$sitesCollection = $sitesSection.GetCollection() &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #008000"&gt;#Find Site&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;foreach&lt;/span&gt; ($item &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; $sitesCollection){ &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; ($item.Attributes.Item(&lt;span style="color: #006080"&gt;&amp;quot;Name&amp;quot;&lt;/span&gt;).Value &lt;span style="color: #cc6633"&gt;-eq&lt;/span&gt; $siteName){&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;        $site = $item&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #008000"&gt;#Validation&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;if&lt;/span&gt; ($site &lt;span style="color: #cc6633"&gt;-eq&lt;/span&gt; $null) { &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    Write-Host &lt;span style="color: #006080"&gt;&amp;quot;Site '$siteName' not found&amp;quot;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;return&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #008000"&gt;#Flush the Logs&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;$ftpServer = $site.ChildElements.Item(&lt;span style="color: #006080"&gt;&amp;quot;ftpServer&amp;quot;&lt;/span&gt;)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (!($ftpServer.ChildElements.Count)){&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    Write-Host &lt;span style="color: #006080"&gt;&amp;quot;Site '$siteName' does not have FTP bindings set&amp;quot;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;return&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;$ftpServer.Methods.Item(&lt;span style="color: #006080"&gt;&amp;quot;FlushLog&amp;quot;&lt;/span&gt;).CreateInstance().Execute()&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;I hope one of these programming/scripting options come in handy for times when you want immediate access to the latest FTP log data.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8280314" width="1" height="1"&gt;</content><author><name>OWScott</name><uri>http://weblogs.asp.net/members/OWScott.aspx</uri></author><category term="IIS" scheme="http://weblogs.asp.net/owscott/archive/tags/IIS/default.aspx" /><category term="IIS7" scheme="http://weblogs.asp.net/owscott/archive/tags/IIS7/default.aspx" /><category term="Windows Server" scheme="http://weblogs.asp.net/owscott/archive/tags/Windows+Server/default.aspx" /></entry><entry><title>IIS FTP User Isolation-Week 46</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/owscott/archive/2012/01/23/iis-ftp-user-isolation-week-46.aspx" /><id>http://weblogs.asp.net/owscott/archive/2012/01/23/iis-ftp-user-isolation-week-46.aspx</id><published>2012-01-23T16:34:37Z</published><updated>2012-01-23T16:34:37Z</updated><content type="html">&lt;p&gt;You can find this week’s &lt;a href="http://dotnetslackers.com/articles/iis/IIS-FTP-User-Isolation-Week-46.aspx"&gt;video here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;I’ve been looking forward to releasing this week’s video.&amp;#160; IIS FTP User isolation is an interesting topic because it offers a lot of power and flexibility but it’s not very intuitive because of how it’s managed.&lt;/p&gt;  &lt;p&gt;This week we walk through the five isolation modes to gain a full understanding of the IIS FTP method of configuration for user isolation.&lt;/p&gt;  &lt;p&gt;IIS FTP is a powerful application, but some of the flexibility is hidden through a unique convention based method of management. It’s easy to miss the fact that IIS FTP allows the ability to have multiple users who can be directed to different folders and be fully isolated from each other. For example, you can have a designer1 who has access to the whole site while designer2 has access to just project1 only, while—if you set it up correctly—you can feel confident that designer2 can’t gain more access than they are allowed.&lt;/p&gt;  &lt;p&gt;IIS FTP requires understanding a few core principles to manage it effectively and to ensure that you don’t overlook key security settings that would allow users to gain more access than they should. IIS FTP 7.5 offers five different isolation modes, each of which targets a different situation.&lt;/p&gt;  &lt;p&gt;This is now week 46 of a 52 week series for the web pro, and the 3rd of a 5 week mini-series on IIS FTP. You can view past and future weeks here: &lt;a href="http://dotnetslackers.com/projects/LearnIIS7/"&gt;http://dotnetslackers.com/projects/LearnIIS7/&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Also, if you’re reading this early enough, I’m taking questions for the last couple weeks of the series.&amp;#160; Read more about it &lt;a href="http://weblogs.asp.net/owscott/archive/2011/12/18/accepting-questions-for-web-pro-series-q-amp-a.aspx"&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;You can find this week’s &lt;a href="http://dotnetslackers.com/articles/iis/IIS-FTP-User-Isolation-Week-46.aspx"&gt;video here&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8267305" width="1" height="1"&gt;</content><author><name>OWScott</name><uri>http://weblogs.asp.net/members/OWScott.aspx</uri></author><category term="IIS" scheme="http://weblogs.asp.net/owscott/archive/tags/IIS/default.aspx" /><category term="FTP" scheme="http://weblogs.asp.net/owscott/archive/tags/FTP/default.aspx" /><category term="IIS7" scheme="http://weblogs.asp.net/owscott/archive/tags/IIS7/default.aspx" /><category term="Web Pro Series" scheme="http://weblogs.asp.net/owscott/archive/tags/Web+Pro+Series/default.aspx" /></entry></feed>