The following rule generates a server 500 error. If I comment it out then I don't get the error. How do I troubleshoot this? Are there any log files that are created by the rewriting engine?
The best way to troubleshoot the rule is to use the Failed Request Tracing (FRT). Refer to this
article for step by step instructions on how to configure FRT with URL rewriter.
Jason Hill
29 Posts
Troubleshoot 500 Errors
Jun 24, 2008 09:15 PM|LINK
The following rule generates a server 500 error. If I comment it out then I don't get the error. How do I troubleshoot this? Are there any log files that are created by the rewriting engine?
<rule name="Rule0050" stopProcessing="true">
<match url="^(Mobile)(.*)?" />
<conditions logicalGrouping="MatchAll">
<add input="{HTTP_HOST}" pattern="^(prototype\.)?broadband\.(.*)" />
</conditions>
<action type="Redirect" url="http://{C:1}mobile-phones.{C:2}/{R:1}{R:2}" appendQueryString="true" redirectType="Permanent" />
</rule>
Thanks,
Jason
ruslany
900 Posts
Microsoft
Moderator
Re: Troubleshoot 500 Errors
Jun 24, 2008 10:24 PM|LINK
The best way to troubleshoot the rule is to use the Failed Request Tracing (FRT). Refer to this article for step by step instructions on how to configure FRT with URL rewriter.
What is the requested URL that causes 500 error?
Rules
Jason Hill
29 Posts
Re: Troubleshoot 500 Errors
Jun 25, 2008 09:00 PM|LINK
The tracing capability in IIS7 is very cool.
Ruslan has identified that it is an optional element in the rewrite rule that is causing the problem and this is a known issue with the tech preview.
So, the bold sections of my rewrite rule below are dealing with optional elements that are back referenced in my action tag.
<rule name="Rule0050" stopProcessing="true">
<match url="^(Mobile)(.*)?" />
<conditions logicalGrouping="MatchAll">
<add input="{HTTP_HOST}" pattern="^(prototype\.)?broadband\.(.*)" />
</conditions>
<action type="Redirect" url="http://{C:1}mobile-phones.{C:2}/{R:1}{R:2}" appendQueryString="true" redirectType="Permanent" />
</rule>
I changed the rule to eliminate the optional elements and it works OK now:
<rule name="Rule0050" stopProcessing="true">
<match url="^(Mobile|Mobile.*)$" />
<conditions logicalGrouping="MatchAll">
<add input="{HTTP_HOST}" pattern="^(prototype\.broadband\.|broadband\.)(.*)" />
</conditions>
<action type="Redirect" url=http://{C:1}mobile-phones.{C:2}/{R:1}" appendQueryString="true" redirectType="Permanent" />
</rule>
Ruslan said that this will be fixed in a future release.
Jason