<?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">
<!--
Configuration file for UrlRewriteFilter
http://tuckey.org/urlrewrite/
-->
<urlrewrite>
<rule>
<note>
The rule means that requests to /test/status/ will be redirected to /rewrite-status
the url will be rewritten.
</note>
<from>/test/status/</from>
<to type="redirect">%{context-path}/rewrite-status</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>/rewrite-status</from>
<to>/test/status/</to>
</outbound-rule>
<rule>
<from>^/use/list.html</from>
<to>/use/list.jsp</to>
</rule>
<!--
INSTALLATION
in your web.xml add...
<filter>
<filter-name>UrlRewriteFilter</filter-name>
<filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class>
<init-param>
<param-name>logLevel</param-name>
<param-value>WARN</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>UrlRewriteFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
EXAMPLES
Redirect one url
<rule>
<from>/some/old/page.html</from>
<to type="redirect">/very/new/page.html</to>
</rule>
Redirect a directory
<rule>
<from>/some/olddir/(.*)</from>
<to type="redirect">/very/newdir/$1</to>
</rule>
Clean a url
<rule>
<from>/products/([0-9]+)</from>
<to>/products/index.jsp?product_id=$1</to>
</rule>
eg, /products/1234 will be passed on to /products/index.jsp?product_id=1234 without the user noticing.
Browser detection
<rule>
<condition name="user-agent">Mozilla/[1-4]</condition>
<from>/some/page.html</from>
<to>/some/page-for-old-browsers.html</to>
</rule>
eg, will pass the request for /some/page.html on to /some/page-for-old-browsers.html only for older
browsers whose user agent srtings match Mozilla/1, Mozilla/2, Mozilla/3 or Mozilla/4.
-->
</urlrewrite>
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
每个网页或请求都是一个url地址,一般,这个地址可能是.do,.page,.action之类的并加上'?'号、'&'号查询串等构成的一个长长的的url。很urgly。 一般的url----------------------------------------------------------较好的url http://www.xxx.net/user/profile.do?id=20001 ====> http://www.xxx.net/user/20001 http://www.xxx.net/forum/board.do?name=java ====> http://www.xxx.net/forum/java http://www.xxx.net/forum/thread.do?id=29923 ====> http://www.xxx.net/thread/29923 后者明显较为直观和漂亮。 使用url rewrite可以很好的改善这个状况。网站url rewrite应用是非常广泛的,良好的url设计给用户带来的非常好的体验,同时也能吸引搜索引擎的注意。 一种rewrite称为一个规则,上面的例子就是3个规则。rewrite技术可以在代理服务器实现,或者可以在tomcat之类的java web服务器实现。 Apache HTTP Server 2.x 和 mod_proxy提供了不错的Rewrite处理方法。so如果使用apache,则直接在apache中配置Rewrite即可。但是对于没有使用代理,或者不完全要在代理服务器配置Rewrite的web应用,通过第三方Jar包也是可以实现很perfect的rewrite技术的。
资源推荐
资源详情
资源评论
收起资源包目录
testURLRewrite.rar (10个子文件)
testURLRewrite
src
.project 1KB
WebRoot
META-INF
MANIFEST.MF 39B
WEB-INF
urlrewrite.xml 3KB
web.xml 871B
classes
lib
urlrewrite-2.6.0.jar 145KB
index.jsp 829B
use
urltest.jsp 421B
list.jsp 923B
.mymetadata 315B
.classpath 419B
.myeclipse
共 10 条
- 1
资源评论
六月澎湃
- 粉丝: 2
- 资源: 20
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于springboot+layui的医院日常耗材管理系统.zip
- 计算机毕业设计-ASP.NET教育报表管理系统-权限管理模块(源代码+)-毕设源码实例.zip
- 计算机毕业设计-ASP.NET教务信息管理系统的设计与实现(源代码+)-毕设源码实例.zip
- Eleven的精益供应链管理-碓胤咨询龚胤全.rar
- 5套光伏、储能、充电收益测算表.zip
- C2 供应链集成演示平台操作手册(详细版).rar
- 3套光储充一体化站CAD+PDF图纸.zip
- Screenshot_20240426_195831_com.huawei.android.launcher.jpg
- 2000-2023年各省专利侵权结案数据.xlsx
- C#使用NPOI操作合并单元格
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功