First and foremost, thank you for your time with my question.
I am attempting to forward all traffic from http:// and https:// to "https://www.[domain].com/[etc]" I am currently able to force all "www." traffic to "https://www." using the setup in httpd.conf below:
<VirtualHost *:80>
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^.*$ https://{%SERVER_NAME}%{REQUEST_URI}
</VirtualHost>
This setup is unfortunately inconsistent. If for instance I enter "https://[domain].com" into a browser address bar, it will not redirect. On some browsers, "http://[domain].com" will redirect to the non-www "https://[domain].com" as well.
Long story short, I am having trouble setting up a proper redirect from any domain prefix to "https://www" on an Amazon EC2 Instance within the httpd.conf file. If you can help me out here, I'd really appreciate it. Thank you again for your time.
Edit: There is another Q&A that goes over general rewrite rules, however there are some specific rules for the Amazon EC2 (ELB) that are not covered in that answer. Frankly, I'm not sure if the Amazon EC2 specifics apply to my question, but the code I have (x-forwarded-proto) is specific for the ELB.
For what it's worth, I'm asking this question because all of my resources have been exhausted. If I found (or find) an answer somewhere else, I will happily update my question with information and a link.
Edit2: The following code redirects from [domain].com, http://[domain.com], and http://www.[domain].com to https://www.[domain].com. Unfortunately https://[domain].com still does not redirect.
<VirtualHost *:80>
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^.*$ https://{%SERVER_NAME}%{REQUEST_URI}
RewriteCond %{HTTP_HOST} !^www\.
RewriteCond %{HTTPS}s ^on(s)|
RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</VirtualHost>
Is there a different VirtualHost I need to have set up for the https:// domain redirect?