<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.iis.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:cs="http://blogs.iis.net/"><channel><title>IIS7 - URL Rewrite Module</title><link>http://forums.iis.net/1152.aspx</link><description>All about the URL Rewrite Module for IIS 7.0. Use this forum to ask URL Rewiter questions, discuss issues, and request features.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: Installed, configured and tested pattern, rules don't work</title><link>http://forums.iis.net/thread/1909918.aspx</link><pubDate>Fri, 10 Jul 2009 16:28:53 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1909918</guid><dc:creator>salzano</dc:creator><slash:comments>0</slash:comments><comments>http://forums.iis.net/thread/1909918.aspx</comments><wfw:commentRss>http://forums.iis.net/commentrss.aspx?SectionID=1152&amp;PostID=1909918</wfw:commentRss><description>&lt;p&gt;Yes, the www version works without the rules.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;I have solved the issue after thinking about our last exchange. I learned that IIS 7 returns an empty 200 response for a domain that resolves at the server but is not bound to any website profile. I was used to the 400 bad request error that is returned by IIS 6 in the same situation, and assumed that somehow my redirect rule was causing the empty 200.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Installed, configured and tested pattern, rules don't work</title><link>http://forums.iis.net/thread/1909913.aspx</link><pubDate>Fri, 10 Jul 2009 16:04:49 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1909913</guid><dc:creator>ruslany</dc:creator><slash:comments>0</slash:comments><comments>http://forums.iis.net/thread/1909913.aspx</comments><wfw:commentRss>http://forums.iis.net/commentrss.aspx?SectionID=1152&amp;PostID=1909913</wfw:commentRss><description>&lt;p&gt;If you disable or remove the rewrite rule, are you able to successfully browse to either www or non-www version?&lt;/p&gt;</description></item><item><title>Re: Installed, configured and tested pattern, rules don't work</title><link>http://forums.iis.net/thread/1909870.aspx</link><pubDate>Fri, 10 Jul 2009 13:25:06 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1909870</guid><dc:creator>salzano</dc:creator><slash:comments>0</slash:comments><comments>http://forums.iis.net/thread/1909870.aspx</comments><wfw:commentRss>http://forums.iis.net/commentrss.aspx?SectionID=1152&amp;PostID=1909870</wfw:commentRss><description>&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/iis/images/icon-quote.gif"&gt; &lt;strong&gt;ruslany:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;&lt;/p&gt;&lt;p&gt;The redirection URL does not look right. Try this:&lt;/p&gt;
&lt;p&gt;&amp;lt;action type=&amp;quot;Redirect&amp;quot; url=&amp;quot;http://www.d*********.com/{R:1}&amp;quot; redirectType=&amp;quot;Permanent&amp;quot; /&amp;gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Again, your suggestion makes sense, but didn&amp;#39;t help. I can get the www version to work and the non-www returns a zero byte 200 response. If I change the pattern on the HTTP_HOST to match with the www, Firefox tells me I have a redirect loop, which makes sense. I am matching the www version and rewriting it to the www version. However, I can&amp;#39;t seem to get the non-www version to do anything but show an empty 200 or error if I mangle the webconfig. &lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I am going to step back and maybe reinstall some things today. Perhaps I should do as I was with IIS 6.0, and create a separate website profile for the non-www version, and redirect that whole profile to the profile with the www. &lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Thanks again for your help.&amp;nbsp; &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Installed, configured and tested pattern, rules don't work</title><link>http://forums.iis.net/thread/1909832.aspx</link><pubDate>Fri, 10 Jul 2009 06:48:56 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1909832</guid><dc:creator>ruslany</dc:creator><slash:comments>0</slash:comments><comments>http://forums.iis.net/thread/1909832.aspx</comments><wfw:commentRss>http://forums.iis.net/commentrss.aspx?SectionID=1152&amp;PostID=1909832</wfw:commentRss><description>&lt;p&gt;The redirection URL does not look right. Try this:&lt;/p&gt;
&lt;p&gt;&amp;lt;action type=&amp;quot;Redirect&amp;quot; url=&amp;quot;http://www.d*********.com/{R:1}&amp;quot; redirectType=&amp;quot;Permanent&amp;quot; /&amp;gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Installed, configured and tested pattern, rules don't work</title><link>http://forums.iis.net/thread/1909809.aspx</link><pubDate>Thu, 09 Jul 2009 20:23:06 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1909809</guid><dc:creator>salzano</dc:creator><slash:comments>0</slash:comments><comments>http://forums.iis.net/thread/1909809.aspx</comments><wfw:commentRss>http://forums.iis.net/commentrss.aspx?SectionID=1152&amp;PostID=1909809</wfw:commentRss><description>&lt;p&gt;Hey, that makes sense. I followed your advise, and now this website&amp;#39;s webconfig looks like this:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;&amp;lt;configuration&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;system.webServer&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;rewrite&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;rules&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;rule name=&amp;quot;non-www&amp;quot; stopProcessing=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;match url=&amp;quot;(.*)&amp;quot; /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;conditions&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;add input=&amp;quot;{HTTP_HOST}&amp;quot; pattern=&amp;quot;^d*********\.com$&amp;quot; /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/conditions&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;action type=&amp;quot;Redirect&amp;quot; url=&amp;quot;www.d*********.com{R:1}&amp;quot; appendQueryString=&amp;quot;false&amp;quot; redirectType=&amp;quot;Permanent&amp;quot; /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/rule&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/rules&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/rewrite&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/system.webServer&amp;gt;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;lt;/configuration&amp;gt; &lt;/p&gt;&lt;p&gt;&amp;nbsp;I can&amp;#39;t help but notice the slight differences. I have no negate=true, and I don&amp;#39;t have the www in the condition pattern because I am trying to match requests that come in without it. I have tried with &amp;nbsp; &amp;lt;add input=&amp;quot;{HTTP_HOST}&amp;quot; pattern=&amp;quot;^www.d*********\.com$&amp;quot; /&amp;gt;&amp;nbsp; too, but I still get a blank 200 response on the non-www version of the site.&lt;/p&gt;&lt;p&gt; This is running on Windows Server Web SP1.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Installed, configured and tested pattern, rules don't work</title><link>http://forums.iis.net/thread/1909630.aspx</link><pubDate>Wed, 08 Jul 2009 17:58:24 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1909630</guid><dc:creator>ruslany</dc:creator><slash:comments>0</slash:comments><comments>http://forums.iis.net/thread/1909630.aspx</comments><wfw:commentRss>http://forums.iis.net/commentrss.aspx?SectionID=1152&amp;PostID=1909630</wfw:commentRss><description>&lt;p&gt;The test pattern feature just tests the pattern agains any input string. It does not know whether the input string is a URL path or a domain name.&lt;/p&gt;
&lt;p&gt;At runtime the rule pattern is always evaluated against the URL path. The domain name is not included in that. For example if you request http://mydomain.com/foo/bar/file.aspx, then the rewrite rule pattern will be evaluated against &amp;quot;foo/bar/file.aspx&amp;quot;. In order to check the domain name within the rewrite rule you need to add a condition that checks the {HTTP_HOST}:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;lt;rule name=&amp;quot;WWW&amp;quot; enabled=&amp;quot;true&amp;quot; stopProcessing=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;lt;match url=&amp;quot; (.*)&amp;quot; /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;lt;conditions &amp;gt;&lt;br /&gt;&amp;nbsp; &amp;lt;add input=&amp;quot;{HTTP_HOST}&amp;quot; pattern=&amp;quot;^www\.mydomain\.com$&amp;quot;&amp;nbsp;negate=”true” /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;lt;/conditions&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;lt;action type=&amp;quot;Redirect&amp;quot; url=http://www.mydomain.com/{R:1} redirectType=&amp;quot;Permanent&amp;quot; /&amp;gt;&lt;br /&gt;&amp;lt;/rule&amp;gt;&lt;/code&gt;&lt;/p&gt;</description></item><item><title>Re: Installed, configured and tested pattern, rules don't work</title><link>http://forums.iis.net/thread/1909585.aspx</link><pubDate>Wed, 08 Jul 2009 13:01:51 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1909585</guid><dc:creator>salzano</dc:creator><slash:comments>0</slash:comments><comments>http://forums.iis.net/thread/1909585.aspx</comments><wfw:commentRss>http://forums.iis.net/commentrss.aspx?SectionID=1152&amp;PostID=1909585</wfw:commentRss><description>&lt;p&gt;Thanks for your quick response. &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/iis/images/icon-quote.gif"&gt; &lt;strong&gt;ruslany:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;The rule will not work because the url pattern will never match the request.&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/p&gt;&lt;p&gt;There has to be some other problem, because the &amp;quot;Test Pattern&amp;quot; feature in the IIS Rewrite module tells me that www.mysite.com/something does not match the pattern and mysite.com/something does match the pattern. &lt;/p&gt;&lt;p&gt;Here&amp;#39;s a screen shot of that happening: http://twitpic.com/9oiop &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Installed, configured and tested pattern, rules don't work</title><link>http://forums.iis.net/thread/1909546.aspx</link><pubDate>Wed, 08 Jul 2009 03:39:13 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1909546</guid><dc:creator>ruslany</dc:creator><slash:comments>0</slash:comments><comments>http://forums.iis.net/thread/1909546.aspx</comments><wfw:commentRss>http://forums.iis.net/commentrss.aspx?SectionID=1152&amp;PostID=1909546</wfw:commentRss><description>&lt;p&gt;The rule will not work because the url pattern will never match the request. Check out this post for an example of how to write a &amp;quot;redirect to www&amp;quot; rule: &lt;a href="http://ruslany.net/2009/04/10-url-rewriting-tips-and-tricks/"&gt;http://ruslany.net/2009/04/10-url-rewriting-tips-and-tricks/&lt;/a&gt;, see tip #3.&lt;/p&gt;
&lt;p&gt;Also, for more details about how to access parts of URL within a rewrite rule refer here: &lt;a href="http://learn.iis.net/page.aspx/465/url-rewrite-module-configuration-reference/#Accessing_URL_Parts_from_a_Rewrite_Rule"&gt;http://learn.iis.net/page.aspx/465/url-rewrite-module-configuration-reference/#Accessing_URL_Parts_from_a_Rewrite_Rule&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Installed, configured and tested pattern, rules don't work</title><link>http://forums.iis.net/thread/1909513.aspx</link><pubDate>Tue, 07 Jul 2009 21:03:28 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:1909513</guid><dc:creator>salzano</dc:creator><slash:comments>0</slash:comments><comments>http://forums.iis.net/thread/1909513.aspx</comments><wfw:commentRss>http://forums.iis.net/commentrss.aspx?SectionID=1152&amp;PostID=1909513</wfw:commentRss><description>&lt;p&gt;What am I missing? &lt;/p&gt;
&lt;p&gt;I built the rewrite rule through the interface, but the webconfig looks like this:&lt;/p&gt;
&lt;p&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;&amp;lt;configuration&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;system.webServer&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;rewrite&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;rules&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;rule name=&amp;quot;non-www&amp;quot; stopProcessing=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;match url=&amp;quot;^mysite\.com(.*)&amp;quot; /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;action type=&amp;quot;Redirect&amp;quot; url=&amp;quot;&lt;a href="http://www.mysite.com%7br:1/"&gt;www.mysite.com{r:1&lt;/a&gt;}&amp;quot; appendQueryString=&amp;quot;false&amp;quot; redirectType=&amp;quot;Permanent&amp;quot; /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/rule&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/rules&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/rewrite&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/system.webServer&amp;gt;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;lt;/configuration&amp;gt;&lt;/p&gt;
&lt;p&gt;I am not using any .NET code or Visual Studio to create websites. I work with source code directly in TextPad, and all the files in the directory are .asp&lt;/p&gt;
&lt;p&gt;The www version of the website works fine, but the non-www version returns a 200 of zero byte length. This behavior occured before installing the IIS Rewrite add-on altogether. I am trying to create a rule to make the non-www redirect to the www version of this website. &lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;</description></item></channel></rss>