url rewrite

 
http://urlrewritefilter.googlecode.com/svn/trunk/src/doc/manual/3.1/index.html

urlrewritefilter-3.1.0.zip

1、Add the following to your WEB-INF/web.xml (add it near the top above your servlet mappings (if you have any)): (see filter parameters for more options)

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


2、Add your own configuration to the WEB-INF/urlrewrite.xml that was created.

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE urlrewrite
	PUBLIC "-//tuckey.org//DTD UrlRewrite 3.0//EN"
	"http://tuckey.org/res/dtds/urlrewrite3.0.dtd">
<urlrewrite>
	<rule>
	   <from>^/some/olddir/(.*)$</from>
	   <to type="redirect">/very/newdir/$1</to>
	</rule>
	<rule match-type="wildcard">
	   <from>/blog/archive/**</from>
	   <to type="redirect">/roller/history/$1</to>
	</rule>
</urlrewrite>

3、Restart the context

 

你可能感兴趣的:(Web,xml,SVN,servlet,Blog)