URL修改 如何把旧url重定向到新的url 现在的问题是.我的一个栏目模块的主页路径修改了可是搜索引擎已经收录了进去这个旧地址那我如何把旧的url重定向到新的url上 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 在你的旧页面上直接转发到新的页面上 或者写个action转发 只能页面跳转啊。不是常看到吗: 您访问的页面已经迁移到XXXX。 如果该页面没有自动跳转请点击链接。 到google里搜urlrewrite url重写,你就知道了。 <?xml version="1.0" encoding="utf-8"?><!DOCTYPE urlrewrite PUBLIC "-//tuckey.org//DTD UrlRewrite 3.2//EN" "http://tuckey.org/res/dtds/urlrewrite3.2.dtd"><urlrewrite> <rule> <from>/p/([^_\.]+)(?:_(\d+))?(?:_(\d+))?(?:\.jpg)?</from> <to type="forward">/pictures.htm?id=$1&w=$2&h=$3</to> </rule> <rule> <from>/home.html(\?.+)?</from> <to>/home/index.htm$1</to> </rule> <rule> <from>/request.html(\?.+)?</from> <to>/home/request.htm$1</to> </rule> <rule> <from>/accounts/login.html</from> <to>/accounts/login.jsp</to> </rule> <rule> <from>/accounts/avatar.html</from> <to>/accounts/avatar.htm</to> </rule> <rule> <from>/accounts/profile.html</from> <to>/accounts/profile.htm</to> </rule> <rule> <from>/accounts/password.html</from> <to>/accounts/changePassword.htm</to> </rule> <rule> <from>/accounts/security.html</from> <to>/accounts/security.htm</to> </rule> <rule> <from>/accounts/charge.html</from> <to>/accounts/charge.htm</to> </rule> <rule> <from>/app/([^\?]+)(.+)?</from> <to>/apps/show.htm?s=$1&$2</to> </rule></urlrewrite>这是我的url重写。你可以自己写一个,需要一个jar包,要在web.xml里配置下的。<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> 感觉设置了cookie后session timeout没用 怎样将在jsp页面选择的值(checkbox)传递到action中 jsp向sql2000插入数据后...... java操作xml怎么会这么慢??? 问两天了没人能解决的问题? js转到action后再转的的页面自动关闭!怎么回事 在jscript中如何去除字符串前后的空格 如何将数据库表中每个字段的字段描述在JSP文件中显示出来? 如何把jsp放到虚拟目录上???? 大神们,求教啊.. 急急急!! java中list和数据库查询 登录刷新时防止重复提交 JSP 各种路径问题
您访问的页面已经迁移到XXXX。
如果该页面没有自动跳转请点击链接。
<!DOCTYPE urlrewrite PUBLIC "-//tuckey.org//DTD UrlRewrite 3.2//EN"
"http://tuckey.org/res/dtds/urlrewrite3.2.dtd">
<urlrewrite>
<rule>
<from>/p/([^_\.]+)(?:_(\d+))?(?:_(\d+))?(?:\.jpg)?</from>
<to type="forward">/pictures.htm?id=$1&w=$2&h=$3</to>
</rule>
<rule>
<from>/home.html(\?.+)?</from>
<to>/home/index.htm$1</to>
</rule>
<rule>
<from>/request.html(\?.+)?</from>
<to>/home/request.htm$1</to>
</rule>
<rule>
<from>/accounts/login.html</from>
<to>/accounts/login.jsp</to>
</rule>
<rule>
<from>/accounts/avatar.html</from>
<to>/accounts/avatar.htm</to>
</rule>
<rule>
<from>/accounts/profile.html</from>
<to>/accounts/profile.htm</to>
</rule>
<rule>
<from>/accounts/password.html</from>
<to>/accounts/changePassword.htm</to>
</rule>
<rule>
<from>/accounts/security.html</from>
<to>/accounts/security.htm</to>
</rule>
<rule>
<from>/accounts/charge.html</from>
<to>/accounts/charge.htm</to>
</rule>
<rule>
<from>/app/([^\?]+)(.+)?</from>
<to>/apps/show.htm?s=$1&$2</to>
</rule>
</urlrewrite>
这是我的url重写。你可以自己写一个,需要一个jar包,要在web.xml里配置下的。<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>