<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE urlrewrite PUBLIC "-//tuckey.org//DTD UrlRewrite 2.6//EN"
"http://tuckey.org/res/dtds/urlrewrite2.6.dtd">
<urlrewrite>
<!--
user.do?action=xxxx&id=xxxx&name=iiii
转
page/user/xxxx.xhtml?id=xxxx&name=iiii
user.do?action=xxxx
转
page/user/xxxx.xhtml
反之亦然
-->
<rule>
<note>
NetloanAction
</note>
<from>/page/(.*)/(.*).xhtml</from>
<to>/$1.do?action=$2</to>
</rule>
<rule>
<note>
NetloanAction
</note>
<from>/page/(.*)/(.*).xhtml?(.*)</from>
<to>/$1.do?action=$2&$3</to>
</rule>
<outbound-rule>
<note>
The outbound-rule specifies that when response.encodeURL is
called (if you are using JSTL c:url) the url /rewrite-status
will be rewritten to /test/status/.
The above rule and this outbound-rule means that end users
should never see the url /rewrite-status only /test/status/
both in thier location bar and in hyperlinks in your pages.
</note>
<from>(.*).do\?action=([a-z]*[1-9]*)</from>
<to>%{context-path}/page/$1/$2.xhtml</to>
</outbound-rule>
<outbound-rule>
<note>
The outbound-rule specifies that when response.encodeURL is
called (if you are using JSTL c:url) the url /rewrite-status
will be rewritten to /test/status/.
The above rule and this outbound-rule means that end users
should never see the url /rewrite-status only /test/status/
both in thier location bar and in hyperlinks in your pages.
</note>
<from>(.*).do\?action=([a-z]*[1-9]*)&(.*)</from>
<to>%{context-path}/page/$1/$2.xhtml?$3</to>
</outbound-rule>
</urlrewrite>