现在的问题是.我的一个栏目模块的主页路径修改了
可是搜索引擎已经收录了进去这个旧地址
那我如何把旧的url重定向到新的url上

解决方案 »

  1.   

    在你的旧页面上直接转发到新的页面上 或者写个action转发
      

  2.   

    只能页面跳转啊。不是常看到吗:
      您访问的页面已经迁移到XXXX。
      如果该页面没有自动跳转请点击链接。
      

  3.   

    到google里搜urlrewrite url重写,你就知道了。
      

  4.   

    <?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&amp;w=$2&amp;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&amp;$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>