title: HTTP redirect to HTTPS AWS EC2 with Load Balancer
body: <p>Here's my set up:</p>
  
  <p>EC2 with Apache using elastic load balancer.</p>
  
  <p>I'm looking to have all http traffic redirect automatically to https. I found this reco and tried it by adding to my httpd.conf file:</p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
  RewriteEngine On
  RewriteCond %{HTTP:X-Forwarded-Proto} !https
  RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI}
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>However, this didn't work before or after I restarted the server. HTTP didn't redirect and my sites threw all sorts of errors until I removed the rule from my config.</p>
  
  <p>I'm thinking that I'm updating the file wrong or have the load balancer set up incorrectly. For the listeners for the load balancer I have LB protocol HTTP with port 80 with instance protocol HTTP and instance port 80. I have LB protocol HTTPS on port 443 with instance port 443. My SSL is on this latter protocol.</p>
  
  <p>Any idea where to head from here?</p>