Redirect HTTP to HTTPS:PORT in Tomcat

后端 未结 6 832
傲寒
傲寒 2020-12-08 20:33

I have a running tomcat application that already have the following redirection rule from HTTP to HTTPs:



        
6条回答
  •  温柔的废话
    2020-12-08 21:21

    If you use tomcat with httpd, you can use RewriteEngine.

    With port specified is like the followings in the http.conf:

    NameVirtualHost *:8443 #your specified port
    
       ServerName www.example.com
       Redirect permanent / https://secure.example.com/
    
    

    See: RewriteHTTPToHTTPS and Redirect Request to SSL

提交回复
热议问题