title: tomcat 7: automatically redirect https requests to port 8443
body: <p>On tomcat7, our web application is running through https over port <code>8443</code> and works fine except that we are unable to redirect https default port (<code>443</code>) to <code>8443</code> so as a consequence the ':8443' has to be included in the URL whenever we have to access the application.
  I include some parts of our server.xml file. What should be done in order to be able to load our pages without having to enter port information in the URL?</p>
  
  <pre class="lang-xml prettyprint-override"><code> &lt;Connector port="8080" protocol="HTTP/1.1"
             connectionTimeout="20000"
             URIEncoding="UTF-8"
             enableLookups="false"
             redirectPort="8443" /&gt;
  
  &lt;Connector port="80" protocol="HTTP/1.1"
             connectionTimeout="20000"
             URIEncoding="UTF-8"
             enableLookups="false"
             redirectPort="8443" /&gt;
  
  &lt;Connector port="443" protocol="HTTP/1.1"
             connectionTimeout="20000"
             URIEncoding="UTF-8"
             enableLookups="false"
             redirectPort="8443" /&gt;
  ...
  
  &lt;Connector port="8443"
              maxHttpHeaderSize="65536"
              scheme="https"
              secure="true"
              SSLEnabled="true"
              clientAuth="false"
              enableLookups="true"
              acceptCount="100"
              disableUploadTimeout="true"
              maxThreads="200"
              sslProtocol="TLS"
              keystoreFile="/toto/has/a/certificate.jks"
              keystorePass="totohasapassword"
              protocol="org.apache.coyote.http11.Http11NioProtocol" /&gt;
  </code></pre>