tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Bromley <martin.brom...@sustainable-energy.co.uk>
Subject Re: Redirect HTTP to HTTPS
Date Mon, 01 Aug 2005 13:30:55 GMT
Just create a filter (mapping it to /* for example so it gets applied to all requests), test
for a secure connection with request.isSecure(), and if it isn't, redirect using response.sendRedirect.

Martin

Faine, Mark wrote:
> I know I can redirect HTTP to HTTPS by adding:
>  
>        <user-data-constraint>
>         <transport-guarantee>
>          CONFIDENTIAL
>        </transport-guarantee>
>       </user-data-constraint>
>  
> to my web.xml but the problem is that this does not redirect when someone
> just goes to a directory path.  I would like
>  
> http://servername/
>  
> to redirect to 
>  
> https://servername/
>  
> Thanks,
> -Mark
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message