UrlRewriter.net Expression Examples
Posted
by Tarik
on Stack Overflow
See other posts from Stack Overflow
or by Tarik
Published on 2010-03-18T21:27:03Z
Indexed on
2010/03/18
21:31 UTC
Read the original article
Hit count: 625
urlrewriter.net
Hello,
I need some web.config examples for each expression types below :
$number
The last substring matched by group number number.
$<name>
The last substring matched by group named name matched by (?< name > ).
${property}
The value of the property when the expression is evaluated.
${transform(value)}
The result of calling the transform on the specified value.
${map:value}
The result of mapping the specified value using the map. Replaced with empty string if no mapping exists.
${map:value|default}
The result of mapping the specified value using the map. Replaced with the default if no mapping exists.
Sample:
<rewriter>
<if url="/tags/(.+)" rewrite="/tagcloud.aspx?tag=$1" />
<!-- same thing as <rewrite url="/tags/(.+)" to="/tagcloud.aspx?tag=$1" /> -->
</rewriter>
Thank you very much !
© Stack Overflow or respective owner