<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE urlrewrite PUBLIC "-//tuckey.org//DTD UrlRewrite 4.0//EN"
"http://www.tuckey.org/res/dtds/urlrewrite4.0.dtd">
<urlrewrite decode-using="UTF-8">
<rule>
<from>/$</from>
<to type="forward">/shop/showIndexAll</to>
</rule>
<!-- 手机浏览器包含jsession删掉 ,下面的wildcard:通配符,(regex正则表达式 )-->
<outbound-rule encodefirst="true">
<from>^(.*);jsessionid=.*$</from>
<to>$1</to>
</outbound-rule>
<outbound-rule match-type="wildcard">
<from>*;jsessionid=*</from>
<to>$1</to>
</outbound-rule>
<rule>
<from>index.html</from>
<to type="forward">showIndexAll.action</to>
</rule>
<outbound-rule match-type="regex">
<from>showIndexAll.action</from>
<to>index.html</to>
</outbound-rule>
<!-- 一个ACTION没有方法 -->
<rule>
<from>^/(\w+).html$</from>
<to type="forward">/$1.action</to>
</rule>
<outbound-rule match-type="regex">
<from>/(\w+).action$</from>
<to>/$1.html</to>
</outbound-rule>
<!-- 一个ACTION有方法 -->
<rule>
<from>^/(\w+)!(\w+).html$</from>
<to type="forward">/shop/$1!$2.action</to>
</rule>
<outbound-rule match-type="regex">
<from>(\w+)!(\w+).action$</from>
<to>$1!$2.html</to>
</outbound-rule>
<!-- TOP页面类型过滤 -->
<rule>
<from>(\w+).shtml$</from>
<to type="forward">/shop/commInfoManage!findListByTypeId.action?commTypeId=$1</to>
</rule>
<outbound-rule match-type="regex">
<from>commInfoManage!findListByTypeId.action\?commTypeId=(\w+)$</from>
<to>$1.shtml</to>
</outbound-rule>
<!-- 用户中心 -->
<rule>
<from>ucm.uhtml</from>
<to type="forward">/shop/userCent.action</to>
</rule>
<outbound-rule match-type="regex">
<from>userCent.action$</from>
<to>ucm.uhtml</to>
</outbound-rule>
<!-- <rule>
<from>^/news/([0-9]+).html$</from>
<to>/news/news.jsp?newsId=$1</to>
</rule>
<outbound-rule>
<from>^/shop/news/news.jsp\?newsId=([0-9]+)$</from>
<to>/shop/news/$1.html</to>
</outbound-rule> -->
</urlrewrite>
urlrewrite实战实例
最新推荐文章于 2021-03-03 17:43:39 发布