The if action provides a grouping of other actions. The actions nested within the if action are only executed if the conditions on the if action are matched.

Arguments

conditions
Optional. A set of Conditions which may be specified on this action.

Remarks

This action allows you to group related actions, potentially making your rewriting rules more efficient. For example, if many rules have the same prefix, then you can group them together and ensure that the prefix matches first.

Examples

<if url="^/tags/">
<rewrite url="^/tags/big/(.+)$"
to="/big-tag-cloud.aspx?tag=$1"
processing="stop" />
<rewrite url="^/tags/small/(.+)$"
to="/tiny-tag-cloud.aspx?tag=$1"
processing="stop" />
<rewrite url="^/tags/medium/(.+)$"
to="/normal-tag-cloud.aspx?tag=$1"
processing="stop" />
</if>

See Also