aspose file tools*
The moose likes Tomcat and the fly likes Redirect to https:// Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Redirect to https://" Watch "Redirect to https://" New topic

Redirect to https://

Marty Finn

Joined: Aug 24, 2007
Posts: 7
If you remember a couple months ago, you guys help me setup an SSL certificate on our web server. Now I need a little more help. All works fine when we type in https://blah.blah.blah but it just comes back with a blank page and says done when we use http://

How can I redirect anyone that uses http:// to automatically change to https://

Tomcat 5.0 (Catalina)

[ October 01, 2007: Message edited by: Marty Finn ]
Paul Clapham

Joined: Oct 14, 2005
Posts: 18154

I use a servlet filter for that. But if you're having a problem with what you did, maybe we should try to fix that up.
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

You can either do this programmatically with a filter, as Paul mentioned, or you can do it declaratively by adding a user-data-constraint entry in your deployment descriptor.

In this example, I've added the CONFIDENTIAL constraint to the tomcat/manager app:

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
I agree. Here's the link:
subject: Redirect to https://
Similar Threads
getRequestURL() returning only http instead of https?
SSL certificates for each one of the Tomcat Instances on single machine
Session is not preserverd whn sendRedirect is used ???
Redirect a URL from http 9080 to https 9443
redirect URL using weblogic 9