在IIS URL重写模块字符串函数 [英] String Functions in IIS Url Rewrite Module
问题描述
在 IIS URL重写模块附带3内置的<一个href=\"http://learn.iis.net/page.aspx/465/url-rewrite-module-configuration-reference/#String_functions\"相对=nofollow>功能的:
* 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.
的功能可以通过使用以下语法调用:
{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?
看来你是仅限于使用常规的前pressions和反向引用来构建字符串 - 即没有查找/替换机制来替换的每个的的Y的{} REQUEST_URI,
It seems that you're limited to using regular expressions and back-references to construct strings - i.e. there's no search/replace mechanism to replace every instance of X with Y in {REQUEST_URI}, without knowing how many instances there are.
我已经在可扩展性的在2.0 RTW推出并没有看到这种引入任何光的手段。
I've had a quick glance at the extensibility introduced in the 2.0 RTW and don't see any 'light' means of introducing this.
推荐答案
看起来你必须实现自己的供应商,如下所示:
<一href=\"http://learn.iis.net/page.aspx/804/developing-a-custom-rewrite-provider-for-url-rewrite-module/\" rel=\"nofollow\">http://learn.iis.net/page.aspx/804/developing-a-custom-rewrite-provider-for-url-rewrite-module/
Looks like you have to implement your own provider as shown here:
http://learn.iis.net/page.aspx/804/developing-a-custom-rewrite-provider-for-url-rewrite-module/
这篇关于在IIS URL重写模块字符串函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!