1. 程式人生 > >http如何設定自動跳轉https

http如何設定自動跳轉https

開啟D:/apache-tomcat-6.0.29/conf/web.xml,在該檔案</welcome-file-list>後面加上這樣一段:
<login-config>  
    <!-- Authorization setting for SSL -->  
    <auth-method>CLIENT-CERT</auth-method>  
    <realm-name>Client Cert Users-only Area</realm-name>  
</login-config>  
<security-constraint>  

    <!-- Authorization setting for SSL -->  
    <web-resource-collection >  
        <web-resource-name >SSL</web-resource-name>  
        <url-pattern>/*</url-pattern>  
    </web-resource-collection>  
    <user-data-constraint>  
        <transport-guarantee>CONFIDENTIAL</transport-guarantee>  

    </user-data-constraint>  
</security-constraint>