I want to forcefully redirect a site to a SSL certified site. I have added these config within my server.xml
tomcat config.
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
enableLookups="false"
redirectPort="8443" />
<Connector port="8443" protocol="HTTP/1.1"
SSLEnabled="true" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25"
maxSpareThreads="75" enableLookups="false"
disableUploadTimeout="true" acceptCount="100"
scheme="https" secure="true"
sslProtocol="TLS" keystoreFile="conf/{keystoreName}.jks"
keystorePass="{KeyStorePass}" />
But I ended up with viewing my site in both non-SSL and SSL certified site. How can I restrict and redirect non-SSL certified to SSL one?
EDIT:
Here's the portion of my web.xml:
<security-constraint>
<web-resource-collection>
<web-resource-name>HTTPSOnly</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
<security-constraint>
<web-resource-collection>
<web-resource-name>HTTPSOrHTTP</web-resource-name>
<url-pattern>*.ico</url-pattern>
<url-pattern>/img/*</url-pattern>
<url-pattern>/css/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>NONE</transport-guarantee>
</user-data-constraint>
</security-constraint>