title: apache HTTP:X-Forwarded-Proto in .htaccess is causing redirect loop in dev environment
body: <p>I've had to update my .htaccess from this:</p>
  
  <pre><code>RewriteCond %{HTTPS} !=on
  RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
  </code></pre>
  
  <p>to this:</p>
  
  <pre><code>RewriteCond %{HTTP:X-Forwarded-Proto} !https
  RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
  </code></pre>
  
  <p>to get it working behind an AWS Elasic Load Balancer. </p>
  
  <p>It all seems to work fine on AWS, but in my local environment I'm stuck in a redirect loop. </p>
  
  <p>How I can get this setup to work correctly in both environments?</p>