<
rule
>
<
from
>
^/article.asp\?id=(.*)$
</
from
>
<
to
type
="redirect"
>
/entry/$1.jhtml
</
to
>
</
rule
>
但是我这样的连接总是匹配不到,只要去掉那个?就可以了。这个正则表达式是没有问题的。/article.asp?id=64是可以匹配的到的。
后来看3.0的manual (http://tuckey.org/urlrewrite/manual/3.0/)才发现原来是这个的问题。
<urlrewrite> element
The top level element.
Attribute
Possible Value
Explanation
default-match-type (optional)
|
regex
(default) |
All rules and thier conditions will be processed using the Java Regular Expression engine (unless match-type
is specified on a rule). |
wildcard |
All rules and thier conditions will be processed using the Wildcard Expression engine
(unless match-type
is specified on a rule). |
decode-using (optional)
|
utf8
(default) |
When URL is decoded UTF-8 will be used. |
null |
Do not decode. |
[encoding] |
Any string representing a supported character encoding eg, ISO-8859-1. See Java Charset Object
for more info. |
use-query-string (optional)
|
false
(default) |
The query string will not
be appended to the url that the "from" element matches against. |
true |
The query string will be appended to the url that the "from" element matches against. |
use-context (optional)
|
false
(default) |
The context path will not
be added to the url that the "from" element matches against. |
true |
The context path will be added to the url that the "from" element matches against. |
就是那个use-query-string 的问题,默认的是不使用query-string就是把?后面的都忽略了。所以就不能匹配到了。只要在<urlrewrite>里面加一个属性就可以了。
<
urlrewrite
use-query-string
="true"
>
</
urlrewrite
>
分享到:
相关推荐
什么是UrlRewrite UrlRewrite 是 将动态页面转换为静态页面的一种技术 例如 您网站页面是 http: www yourdomain com news docread aspx id 123 为什么使用UrlRewrite: 1 处理这样的情形:你要更改你的web应用...
在网上找了很多都不合心意,就知道改了下源码,只... ②fileNameRegex 为读取文件匹配(eg:/WEB-INF 目录下有文件urlrewrite_navigater.xml,urlrewrite_personalCenter.xml 两个文件,fileNameRegex为:urlrewrite_)。
urlrewrite重写地址,Urlrewrite 2.5.2 现在有2.6版本的,自己去网上找吧
urlrewrite 只支持单个配置文件,默认的配置文件为:/WEB-INF/urlrewrite.xml 现在对urlrewrite-3.2的源码进行了修改,使它能够支持多文件和通配符的形式加载自定义配置文件,即可以进行如下的配置: <param-name>...
打造UrlRewrite源码 UrlRewrite一般都是在web.config里配置访问规则在路由到实际页面,所以先实现自定义节点信息读取,这里我定义了俩个类 webconfig定义了组,不需要的话可以把UrlRewriteConfigGroup类去掉并修改...
URL Rewrite是微软针对IIS推出的一种对URL进行重写的扩展模块,目前支持用于IIS7及以上版本。该模块使IIS管理员能够创建强大的自定义规则,语法支持正则规则以及通配符规则过滤。它能够根据HTTP头和IIS服务器变量...
urlrewrite Jar包 urlrewrite-3.1.0.jar
UrlReWrite(Url重写或伪静态)UrlReWrite(Url重写或伪静态)
UrlRewrite.rarUrlRewrite.rar
IIS URL Rewrite模块(URL 重写)
URLRewrite URL重写组件 里边有相关配置说明 包括了web.Config 外附一个Css
URLRewrite使用时候一些属性的配置说明
UrlRewrite.dll 在使用开发的时候,win7或者win8的系统,可能会需要
java urlrewrite demo
urlrewrite 4.0.3 jar
iis urlrewrite文件
urlrewrite 没听说吗? 用于url美化的 不过好像大多数会考虑伪静态~~~~~! 这个demo是eclipse工程 包括全部包 实现静态模拟及传参
url rewrite组件下载
urlrewrite,实现伪静态页面,UrlRewrite技术隐藏实现细节,这样修改移植都很方便,而且完全不损失pagerank
UrlRewrite域名重写,全套代码,是vs2005.net .net2.0