tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John Roth" <>
Subject RE: Redirect port 80 requests to 443
Date Fri, 07 Jun 2002 19:58:37 GMT
Actually, I took it a step further:  I wanted to be sure that anyone who
goes to http: gets redirected.  With just a simple redirection page, someone
could still go http://oursite/ourapp and get by without using SSL.

Here's what I did:
1. added a new Service with the http connector (port 80) and a single app
with 1 page (index.html) and web.xml.
2. The index.html redirects them to https:
3. Snippets of code from server.xml:

<Service name="Tomcat-(Redirector)">
   <Connector className="org.apache.catalina.connector.http.HttpConnector"
address="x.x.x.x" port="80" {remainder removed for ease}/>
        <Engine name="Redirector" defaultHost="localhost">
            <Host name="localhost" debug="4" appBase="webapps"
                <Context path="" docBase="e:/staging/wwwroot/Redirector"
  <Service name="Tomcat-(Staging)">
    <Connector className="org.apache.catalina.connector.http.HttpConnector"
address="x.x.x.x" port="443" {remainder removed}>
        <Factory className=""
{remaining SSL Factory stuff}/>
    <Engine name="Standalone" defaultHost="localhost">
... remainder of server.xml ...


-----Original Message-----
From: Richard S. Huntrods []
Sent: Friday, June 07, 2002 3:38 PM
Subject: RE: Redirect port 80 requests to 443

John Roth said:
This seems simple, but ...

I am running Tomcat 4.0.3, standalone on w2k.  I would like all requests
http://oursite/ to be automatically redirected to https://oursite/ but
not finding an elegant/simple solution.  Below is a snippet from

Why not simply create a web page that automatically redirects the
request to the https page?  That is what I did and it works fine.


To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message