怎样配置urlrewrite.xml实现跨域名伪静态
具体要求是,我有2个域名:cp.xxxx.com和www.xxxx.com
其中cp.xxxx.com有info/xx.jsp页面,
不用urlrewrite时在www.xxxx.com首页用程序调用产品信息后详细信息链接到叶面cp.xxxx.com/info/xx.jsp?id=<%id%>
当我用为静态时改怎么配置啊???我在cp.xxxx.com里用程序调用产品信息后详细信息链接到叶面cp.xxxx.com/info/xx.jsp?id=<%id%>伪静态链接为cp.xxxx.com/info/xx/<%id%>.html
附cp.xxxx.com里为静态配置:
<rule>  
    <from>^/info/xx/myinfo_168([0-9]+).html$</from>  
    <to>/info/xx.jsp?id=$1</to>  
    </rule>我会都在一个站点下配置,可是跨域名站点就不会了,请高手指点我啊?

解决方案 »

  1.   

    首先肯定是要把jar包放到lib下面,然后在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-pattern>/*</url-pattern>
    </filter-mapping>再添加urlrewrite.xml 在里面写上自己要写的rule就ok了.
      

  2.   

    <to type="redirect">http://www.xxxx.com/s2/login</to>
    按这个模式就可以了