urlrewrite 匹配规则之优先选择
来源:互联网 发布:atlas apache 编辑:程序博客网 时间:2024/06/15 23:43
urlrewrite rule可以使用java的正则表达式匹配规则,但是这里存在一个问题点,假如有一个通配的规则和一个精确匹配的规则,urlrewrite 会选择那个去匹配呢?
如下两种规则:
<from>^/ajax/(\w+)(.html)$</from><to type="forward">/ajax/$1.action</to><from>^/(\w+)/(\w+)(.html)$</from><to type="forward">/$1-$2.action</to>
urlrewrite.xml文件
<!--Warning 警告:在urlrewrite尽量少的使用通配的规则;由于它匹配到一个就不再匹配第二个了,所以即便是有更加精确的匹配,如果写在通用的匹配规则之后,还是无法匹配的,这是个问题点。望君注意!eg: <from>^/ajax/(\w+)(.html)$</from><to type="forward">/ajax/$1.action</to><from>^/(\w+)/(\w+)(.html)$</from><to type="forward">/$1-$2.action</to>如上两种规则:如果请求路径是http://localhost:8080/IcMarket/ajax/login.html显然这两种规则都能匹配:出现的情况就是,这两种规则谁在上面,就现匹配谁的规则;urlrewrite这东西不会像struts2 一样精确的找到最佳匹配的规则,它只要找到一个能够匹配的就不再往下寻找;为了防止你的规则被杂乱无章的匹配,尽量控制好自己想要匹配的原则。-->
- urlrewrite 匹配规则之优先选择
- nginx的优先匹配规则
- IIS UrlRewrite添加规则
- IIS UrlRewrite添加规则
- nginx之location 匹配规则
- urlrewrite伪静态匹配问题
- hdu 2853 (KM,优先选择原来的匹配)
- hdu 3315 (KM,优先选择原来的匹配)
- Android之AutoCompleteTextView自定义匹配规则
- Nginx之location 匹配规则详解
- Nginx之location 匹配规则详解
- Nginx之location 匹配规则详解
- Nginx之location 匹配规则详解
- Nginx之location 匹配规则详解
- Nginx之location 匹配规则详解
- Nginx之location 匹配规则详解
- Nginx之location 匹配规则详解
- Android之IntentFilter的匹配规则
- Iterator的使用
- windows下编译qtwebkit
- 如何给对话框添加位图
- 网络安全软件FileAudit的E-mail设置
- 开博记
- urlrewrite 匹配规则之优先选择
- 如何使用Android系统属性(SystemProperties)
- asp中文数字验证码的实现
- 虚拟内存之倒排页表
- C# 根据日期计算日期周数
- thrift使用小记
- asp生成验证码代码
- 四种实现下载功能的方法
- HorizontalScrollView去掉滚动条