Ubuntu
RewriteEngine on
RewriteCond %{HTTP:CloudFront-Forwarded-Proto} !https
RewriteRule ^(.*) https://%{HTTP_HOST}%{REQUEST_URI} [L]