java主机部署SSL的301跳转一、下载UrlRewriteFilter 上传到WEB-INF/lib目录内 http://downinfo.myhostadmin.net/urlrewritefilter-4.0.3.jar 二、修改WEB-INF/web.xml 编辑WEB-INF/web.xml 在其它servlet mapping前加入 <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> <dispatcher>REQUEST</dispatcher> <dispatcher>FORWARD</dispatcher> </filter-mapping> 三、在WEB-INF下新建urlrewrite.xml文件,加入跳转规则【把abc.com修改成自己的域名】 <urlrewrite> <rule> <name>https redirect</name> <condition name="From-Https" operator="notequal">^on</condition> <from>^/(.*)</from> <to type="permanent-redirect" last="true">https://www.abc.com/$1</to> </rule> </urlrewrite> 注意:本信息来源于网络,若失效请联系程序方咨询处理方法
|