I know how to canonicalise the case of URLs on incoming request to IIS7.5, in fact, there's a built in rule template to start from. But how about outbound (without changing the code)?
This is where I got to so far:
<outboundRules>
<rule name="Outbound lowercase" preCondition="IsHTML" enabled="true">
<match filterByTags="A" pattern="[A-Z]" ignoreCase="false" />
<action type="Rewrite" value="{ToLower:{R:0}}" />
</rule>
<preConditions>
<preCondition name="IsHTML">
<add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
</preCondition>
</preConditions>
</outboundRules>
However, IIS barfs on the action with a 500 implying an invalid web.config, probably on the {ToLower:XXXX} which I stole from the MS-supplied inbound rule template.
Anyone know how to do this?
Anyone know where the options are fully documented (my GoogleNinja skills failed me: I found this but "Specifies value syntax for the rule. This element is available only for the Rewrite action type" is not really comprehensive).
Thanks, Damian
This rule works for me without any errors. The only change to make is with the pattern. Change it from "[A-Z]" to ".*[A-Z].*" so that the replaced value is the entire string and not just the first upper case letter.
As for way you get the syntax error, do you have the outbound rule wrapped within the section? And, check to make sure that you have url rewrite 2.0 installed. Outbound rules were added in v2.0.