urlwrite.xml




1. 下载jar包, 并加入到WEB-INF/lib下
2. 在WEB-INF/web.xml中增加下面的配置
<filter>
<filter-name>UrlRewriteFilter</filter-name>
<filter-class>
org.tuckey.web.filters.urlrewrite.UrlRewriteFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>UrlRewriteFilter</filter-name>
<!-- 拦截所有的url -->
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>


<?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>

<rule>
<note>商品查看</note>
<from>^/goods_([0-9]+).htm$</from>
<to type="forward">/goods.htm?id=$1</to>
</rule>
<rule>
<note>wap商品查看</note>
<from>^/wap/goods_([0-9]+).htm$</from>
<to type="forward">/wap/goods.htm?id=$1</to>
</rule>
<rule>
<note>商品查看</note>
<from>^/goods_([0-9]+)_([a-z]+).htm$</from>
<to type="forward">/goods.htm?id=$1&amp;from=$2</to>
</rule>
<rule>
<note>商品商城分类查看</note>
<from>^/store_goods_list_?([0-9]+).htm$</from>
<to type="forward">/store_goods_list.htm?gc_id=$1</to>
</rule>
<rule>
<note>店铺查看</note>
<from>^/store_([0-9]+).htm$</from>
<to type="forward">/store.htm?id=$1</to>
</rule>
<rule>
<note>店铺导航</note>
<from>^/store_url_([0-9]+).htm$</from>
<to type="forward">/store_url.htm?id=$1</to>
</rule>
<rule>
<note>积分商城礼品查看</note>
<from>^/integral/view_([0-9]+).htm$</from>
<to type="forward">/integral/view.htm?id=$1</to>
</rule>
<rule>
<note>品牌查看商品</note>
<from>^/brand_goods_([0-9]+).htm$</from>
<to type="forward">/brand_goods.htm?id=$1</to>
</rule>
<rule>
<note>店铺分类</note>
<from>^/store_list_([0-9]+).htm$</from>
<to type="forward">/store_list.htm?sc_id=$1</to>
</rule>
<rule>
<note>商城活动</note>
<from>^/activity/index_([0-9]+).htm$</from>
<to type="forward">/activity/index.htm?id=$1</to>
</rule>
<rule>
<note>商品类团购信息查看</note>
<from>^/group/view_goods_([0-9]+).htm$</from>
<to type="forward">/group/view.htm?id=$1&amp;type=goods</to>
</rule>

<rule>
<note>资讯文章</note>
<from>^/cms/detail_([0-9]+).htm$</from>
<to type="forward">/cms/detail.htm?id=$1</to>
</rule>
<rule>
<note>地市首页</note>
<from>^/([A-z]+)/?$</from>
<to type="forward">/index1.htm?city=$1</to>
</rule>
<rule>
<note>列表页</note>
<from>^/([A-z]+)/buy/([-A-z\d]+)?$</from>
<to type="forward">/goodslist.htm?city=$1&amp;con=$2</to>
</rule>
</urlrewrite>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值