title: How to redirect http to https in JBoss EAP 6.4?
body: <p>Here how to set <strong>substitution</strong> to any address so that I can use it in AWS Application Load Balancer.</p>
  
  <pre><code>&lt;subsystem xmlns="urn:jboss:domain:web:2.2" default-virtual-server="default-host" native="false"&gt;
  &lt;connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/&gt;
  &lt;connector name="https" protocol="HTTP/1.1" scheme="https" socket-binding="https"  enable-lookups="false" secure="true" /&gt;
  &lt;virtual-server name="default-host" enable-welcome-root="true"&gt;
      &lt;rewrite pattern="^/(.*)$" substitution="https://localhost:443/$1" flags="RL"&gt;
          &lt;condition test="%{HTTPS}" pattern="off" /&gt;
      &lt;/rewrite&gt;               
      &lt;alias name="localhost"/&gt;
      &lt;alias name="example.com"/&gt;
  &lt;/virtual-server&gt;
  </code></pre>
  
  <p></p>
  
  <p>I want like </p>
  
  <pre><code>&lt;rewrite pattern="^/(.*)$" substitution="https://%HOST_NAME%" flags="RL"&gt;
      &lt;condition test="%{HTTPS}" pattern="off" /&gt;
  &lt;/rewrite&gt;
  </code></pre>