String Functions in IIS Url Rewrite Module

Posted by Nariman on Stack Overflow See other posts from Stack Overflow or by Nariman
Published on 2010-06-11T19:19:52Z Indexed on 2010/06/11 19:33 UTC
Read the original article Hit count: 227

Filed under:
|
|
|
|

The IIS URL Rewrite Module ships with 3 built-in functions:

* ToLower - returns the input string converted to lower case.
* UrlEncode - returns the input string converted to URL-encoded format. This function can be used if the substitution URL in rewrite rule contains special characters (for example non-ASCII or URI-unsafe characters).
* UrlDecode - decodes the URL-encoded input string. This function can be used to decode a condition input before matching it against a pattern.

The functions can be invoked by using the following syntax: {function_name:any_string}

The question is: can this list be extended by introducing a Replace function that's available for changing values within a rewrite rule action or condition?

Another way to frame the question: is there any way to do a global replace on a URL coming in using this module? It seems that you're limited to using regular expressions and back-references to construct strings, without a search/replace functionality to replace every X with Y in {REQUEST_URI} before issuing a redirect.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about iis