<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Scott Forsyth's Blog - All Comments</title><link>http://weblogs.asp.net/owscott/default.aspx</link><description>Postings on IIS, ASP.NET, SQL Server, Webfarms and general system admin.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>re: Using IP Restrictions with URL Rewrite-Week 25</title><link>http://weblogs.asp.net/owscott/archive/2011/06/21/using-ip-restrictions-with-url-rewrite-week-25.aspx#8291566</link><pubDate>Thu, 09 Feb 2012 20:14:42 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:8291566</guid><dc:creator>OWScott</dc:creator><description>&lt;p&gt;Hi Jeffrey,&lt;/p&gt;
&lt;p&gt;There are a couple ways that can probably accomplish this.&lt;/p&gt;
&lt;p&gt;One would be to create 2 identical websites and then using a location tag in applicationHost.config and have one that requires auth and one that doesn't. &amp;nbsp;If you use windows auth then it’s applied to apphost already. &amp;nbsp;Forms auth would need to be applied manually. &amp;nbsp;The reason for doing it in apphost is that it can share the rest of the code base including web.config. &amp;nbsp;Then in ARR you would direct users from the trusted IPs to one site and the rest of the users to the non-trusted site.&lt;/p&gt;
&lt;p&gt;Another option would be to edit your login page code to watch for certain IP addresses and then automatically log them in with a shared anonymous user. &amp;nbsp;That wouldn't use URL Rewrite but can be achieved with some minor edits to the login code.&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8291566" width="1" height="1"&gt;</description></item><item><title>re: Using IP Restrictions with URL Rewrite-Week 25</title><link>http://weblogs.asp.net/owscott/archive/2011/06/21/using-ip-restrictions-with-url-rewrite-week-25.aspx#8291469</link><pubDate>Thu, 09 Feb 2012 18:47:16 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:8291469</guid><dc:creator>Jeffrey</dc:creator><description>&lt;p&gt;How could one handle a senario where you might allow access from certain IP addresses and deny from others _unless_ they can login?&lt;/p&gt;
&lt;p&gt;For example, if you know a certain IP is good (A work site) and then you have mobile users and you want to prompt them to login if they aren&amp;#39;t at work could you use a technique on the second rule that could prompt a login?&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8291469" width="1" height="1"&gt;</description></item><item><title>re: Flush IIS HTTP and FTP Logs to Disk</title><link>http://weblogs.asp.net/owscott/archive/2012/02/03/flush-http-and-ftp-logs-in-iis.aspx#8285603</link><pubDate>Mon, 06 Feb 2012 17:10:31 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:8285603</guid><dc:creator>Kenny</dc:creator><description>&lt;p&gt;Very helpful. &amp;nbsp;Thanks for posting.&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8285603" width="1" height="1"&gt;</description></item><item><title>re: Understanding IIS Bindings</title><link>http://weblogs.asp.net/owscott/archive/2011/01/29/understanding-iis-bindings.aspx#8281709</link><pubDate>Sat, 04 Feb 2012 19:31:23 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:8281709</guid><dc:creator>Vinay Kumar Bammidi</dc:creator><description>&lt;p&gt;Thanks a very useful Information about IIS features and deployment of Website&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8281709" width="1" height="1"&gt;</description></item><item><title>re: Forms Authentication Timeout</title><link>http://weblogs.asp.net/owscott/archive/2006/07/15/Forms-Authentication-Timeout.aspx#8281515</link><pubDate>Sat, 04 Feb 2012 17:28:47 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:8281515</guid><dc:creator>OWScott</dc:creator><description>&lt;p&gt;Good idea. Thanks James for the code example.&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8281515" width="1" height="1"&gt;</description></item><item><title>re: Forms Authentication Timeout</title><link>http://weblogs.asp.net/owscott/archive/2006/07/15/Forms-Authentication-Timeout.aspx#8279720</link><pubDate>Fri, 03 Feb 2012 19:37:46 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:8279720</guid><dc:creator>James</dc:creator><description>&lt;p&gt;Another option would be to programmatically set the timeout from the value specified in the web.config:&lt;/p&gt;
&lt;p&gt;FormsAuthenticationTicket ticket = new FormsAuthenticationTicket&lt;/p&gt;
&lt;p&gt;(&lt;/p&gt;
&lt;p&gt; &amp;nbsp; 1, // version&lt;/p&gt;
&lt;p&gt; &amp;nbsp; txtEmail.Text, // name&lt;/p&gt;
&lt;p&gt; &amp;nbsp; DateTime.Now, // issueDate&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;DateTime.Now.Add(FormsAuthentication.Timeout), // expiration&lt;/p&gt;
&lt;p&gt; &amp;nbsp; false, // isPersistent&lt;/p&gt;
&lt;p&gt; &amp;nbsp; roles, // userData&lt;/p&gt;
&lt;p&gt; &amp;nbsp; FormsAuthentication.FormsCookiePath // cookiePath&lt;/p&gt;
&lt;p&gt; );&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8279720" width="1" height="1"&gt;</description></item><item><title>re: How to find the SiteID in IIS5 and IIS6</title><link>http://weblogs.asp.net/owscott/archive/2005/07/29/how-to-find-the-siteid-in-iis5-and-iis6.aspx#8276229</link><pubDate>Wed, 01 Feb 2012 21:28:05 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:8276229</guid><dc:creator>Tom</dc:creator><description>&lt;p&gt;Great, thanks!&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8276229" width="1" height="1"&gt;</description></item><item><title>re: IIS URL Rewrite – Hosting multiple domains under one site</title><link>http://weblogs.asp.net/owscott/archive/2010/01/26/iis-url-rewrite-hosting-multiple-domains-under-one-site.aspx#8276110</link><pubDate>Wed, 01 Feb 2012 19:01:05 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:8276110</guid><dc:creator>ukon_myst</dc:creator><description>&lt;p&gt;Ok, thank you I will try to work it out! Again, a great blog. Thank you!&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8276110" width="1" height="1"&gt;</description></item><item><title>re: IIS URL Rewrite – Hosting multiple domains under one site</title><link>http://weblogs.asp.net/owscott/archive/2010/01/26/iis-url-rewrite-hosting-multiple-domains-under-one-site.aspx#8275839</link><pubDate>Wed, 01 Feb 2012 15:21:46 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:8275839</guid><dc:creator>OWScott</dc:creator><description>&lt;p&gt;Hi ukon_myst,&lt;/p&gt;
&lt;p&gt;It sounds like you could use two rules. &amp;nbsp;One for the redirect and one for the rewrite. &amp;nbsp;You will need something unique so that you can tell which situations to redirect and which not to. &amp;nbsp;In my example below I used a start of subdir1/subdir2/subdir3/subdir4 but you could use something more general.&lt;/p&gt;
&lt;p&gt;This will redirect from www.subdomain.com (or just subdomain.com) to infrared.subdomain.com (you can pull subdomain.com dynamically with {C:2} if you want).&lt;/p&gt;
&lt;p&gt;Then after it does a client-side redirect for the users' sake, you can do a rewrite so that someone hitting the default page will actally be hitting the default page for your infrared site.&lt;/p&gt;
&lt;p&gt;&amp;lt;rule name=&amp;quot;infrared.subdomain.com - www to infrared&amp;quot; stopProcessing=&amp;quot;true&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;&amp;lt;match url=&amp;quot;^subdir1/subdir2/subdir3/subdir4&amp;quot; /&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;&amp;lt;conditions&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;add input=&amp;quot;{HTTP_HOST}&amp;quot; pattern=&amp;quot;^(www\.)?(subdomain\.com)$&amp;quot; /&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;&amp;lt;/conditions&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;&amp;lt;action type=&amp;quot;Redirect&amp;quot; url=&amp;quot;&lt;a rel="nofollow" target="_new" href="http://infrared.subdomain.com/"&gt;http://infrared.subdomain.com/&lt;/a&gt;{R:0}&amp;quot; /&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/rule&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;rule name=&amp;quot;infrared.subdomain.com ensure subfolder&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;&amp;lt;match url=&amp;quot;^$&amp;quot; /&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;&amp;lt;conditions&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;&amp;lt;add input=&amp;quot;{HTTP_HOST}&amp;quot; pattern=&amp;quot;^infrared\.subdomain\.com$&amp;quot; /&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;&amp;lt;/conditions&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;&amp;lt;action type=&amp;quot;Rewrite&amp;quot; url=&amp;quot;/subdir/subdir2/subdir3/subdir4/page.aspx&amp;quot; /&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/rule&amp;gt;&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8275839" width="1" height="1"&gt;</description></item><item><title>re: IIS URL Rewrite – Hosting multiple domains under one site</title><link>http://weblogs.asp.net/owscott/archive/2010/01/26/iis-url-rewrite-hosting-multiple-domains-under-one-site.aspx#8275801</link><pubDate>Wed, 01 Feb 2012 14:57:06 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:8275801</guid><dc:creator>ukon_myst</dc:creator><description>&lt;p&gt;in addition, if the user uses the url &lt;a rel="nofollow" target="_new" href="http://infrared.ukon_myst.com"&gt;http://infrared.ukon_myst.com&lt;/a&gt; then it should rewrite/redirect to &lt;a rel="nofollow" target="_new" href="http://infrared.ukon_myst.com"&gt;http://infrared.ukon_myst.com&lt;/a&gt;/subdir1/subdir2/subdir3/subdir4/page.aspx&lt;/p&gt;
&lt;p&gt;thanks!&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8275801" width="1" height="1"&gt;</description></item></channel></rss>
