title: How to make "HTTPS redirect" work on WebSphere Application Server Liberty Profile?
body: <p>I want make HTTP Redirect work on WebSphere Application Server Liberty Profile (WLP). For example:-</p>
  
  <p>When user types:
  <code>http://localhost:8080/helloworld</code>, the browser should automatically go (be redirected) to
  <code>https://localhost:9443/helloworld</code></p>
  
  <p>To achieve this, I followed this <a href="http://www.redbooks.ibm.com/redpieces/pdfs/sg248076.pdf" rel="nofollow">document</a>, Section 6.2, page no. 136.</p>
  
  <p>Below is the sample server.xml and web.xml:-</p>
  
  <p><strong>server.xml</strong></p>
  
  <pre><code>&lt;server description="new server"&gt;
  
  &lt;!-- Enable features --&gt;
  &lt;featureManager&gt;
      &lt;feature&gt;jsp-2.2&lt;/feature&gt;
      &lt;feature&gt;wab-1.0&lt;/feature&gt;
      &lt;feature&gt;jaxrs-1.1&lt;/feature&gt;
      &lt;feature&gt;blueprint-1.0&lt;/feature&gt;
      &lt;feature&gt;localConnector-1.0&lt;/feature&gt;
      &lt;feature&gt;ssl-1.0&lt;/feature&gt;
      &lt;feature&gt;appSecurity-2.0&lt;/feature&gt;
  &lt;/featureManager&gt;
  
  &lt;httpEndpoint host="localhost" httpPort="8081" httpsPort="9442" id="defaultHttpEndpoint"&gt;
  &lt;/httpEndpoint&gt;
  
  &lt;applicationMonitor updateTrigger="mbean"/&gt;
  &lt;keyStore id="defaultKeyStore" password="{xor}Lz4sLCgwLTtu"/&gt;
  
  &lt;application id="Hello.app" location="Hello.app.eba" name="Hello.app" type="eba"/&gt;
  </code></pre>
  
  <p></p>
  
  <p><strong>web.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app id="WebApp_ID" version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"&gt;
      &lt;display-name&gt;Hello&lt;/display-name&gt;
  
      &lt;security-constraint&gt;
          &lt;display-name&gt;HTTPS Redirect Security Constraint&lt;/display-name&gt;
          &lt;web-resource-collection&gt;
              &lt;web-resource-name&gt;Sample Web Service service&lt;/web-resource-name&gt;
              &lt;url-pattern&gt;/Hello&lt;/url-pattern&gt;
              &lt;http-method&gt;GET&lt;/http-method&gt;
  
          &lt;/web-resource-collection&gt;
          &lt;user-data-constraint&gt;
              &lt;transport-guarantee&gt;CONFIDENTIAL&lt;/transport-guarantee&gt;
          &lt;/user-data-constraint&gt;
      &lt;/security-constraint&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>Have removed the <code>&lt;servlet&gt;</code> and <code>&lt;servlet-mapping&gt;</code> tag for brevity.</p>
  
  <p>Below are the versions that I am using:-
  Java 7, WLP 8.5.5, Eclipse Juno, Google Chrome.</p>
  
  <p>Any help, guidelines on why HTTPS redirect is not working will be much appreciated.</p>