Here's my set up:
EC2 with Apache using elastic load balancer.
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:
<VirtualHost *:80>
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI}
</VirtualHost>
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.
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.
Any idea where to head from here?