tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John Roth" <john.r...@providersolutions.net>
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"
unpackWARs="true">
                <Context path="" docBase="e:/staging/wwwroot/Redirector"
reloadable="false"/>
                </Host>
            </Engine>
        </Service>
  <Service name="Tomcat-(Staging)">
    <Connector className="org.apache.catalina.connector.http.HttpConnector"
address="x.x.x.x" port="443" {remainder removed}>
        <Factory className="org.apache.catalina.net.SSLServerSocketFactory"
{remaining SSL Factory stuff}/>
      </Connector>
    <Engine name="Standalone" defaultHost="localhost">
... remainder of server.xml ...

Thanks,
John

-----Original Message-----
From: Richard S. Huntrods [mailto:huntrods@nucleus.com]
Sent: Friday, June 07, 2002 3:38 PM
To: tomcat-user@jakarta.apache.org
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
to
http://oursite/ to be automatically redirected to https://oursite/ but
am
not finding an elegant/simple solution.  Below is a snippet from
server.xml:
====

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.

-Richard


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


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


Mime
View raw message