9
votes

Is there an easier way to debug IIS Url Rewrite configurations than this?:

Debug and troubleshoot rewrite rules easily

One of the very cool features of URL Rewrite Module is its integration with IIS Failed Request Tracing. When you have rewrite rules that do not work the way you expect them to work - enable Failed Request Tracing and you will get the entire history of how rewrite rules were applied on the requested URL. I use Failed Request Tracing all the time and it has proven to be a great help when debugging and troubleshooting rewrite rules.

I was able to solve my problem with this info, but it was not really easy to use when you have a complex configuration.

2
Pro tip: Make sure you're using the accompanying XSL stylesheet instead of just looking at the XML. If you open the XML file with Internet Explorer, IE will use the XSL to transform the XML data to a HTML view. This will give you a much better view of the request, and its data. - René

2 Answers

5
votes

Whilst some may say "that's as good as it gets", I'd say that's a pretty neat way to debug rewrite rules. You have full visibility into the pipeline and can see exactly what is happening at each step. I have used this many times to resolve rewrite rule problems. It just takes practice to get familiar with the FRT tool.

5
votes

Change it into a the rewrite to a redirect within the urlrewrite tool for debugging purposes. . .works pretty much the same in the limited exposure I have to it.