简体   繁体   English

要求最大长度的IIS网址重写规则

[英]IIS Url rewrite rule with request max lenght

Based on this question: IIS Rewrite rule based on length param In windows server 2012 IIS, I would like to create a rule that check for the first parameter only for "n" max digits. 基于此问题: 基于长度参数的IIS重写规则在Windows Server 2012 IIS中,我想创建一个仅检查“ n”个最大位数的第一个参数的规则。

the answer proposed gives me an error, 提出的答案给我一个错误,

<match url="product\\/([A-Za-z0-9]{4,100}+)\\/$" />

throws this error: 抛出此错误:

The expression contains a repeat expression (one of '', '?', '+', '{' in most contexts) that is not preceded by an expression. 该表达式包含一个重复表达式(在大多数情况下为”,“?”,“ +”,“ {”之一),该表达式之前没有表达式。

someone else have an idea to resolve? 有人有解决的想法吗? Thank you 谢谢

Your regexp should be like that: product\\/([A-Za-z0-9]{4,100})\\/$ 您的正则表达式应如下所示: product\\/([A-Za-z0-9]{4,100})\\/$

You shouldnt use + if you specified length {4,100} 如果您指定长度{4,100}则不应使用+

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM