I want to force ssl and www for example.com to avoid SSL warnings (because my cert is for www
this is my .ebextensions/http_redirect.config configuration
files:
"/etc/httpd/conf.d/httpd_redirect.conf" :
mode: "000644"
owner: root
group: root
content: |
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule . https://%{SERVER_NAME}%{REQUEST_URI} [L,R=301]
http://example.com is redirecting to https://example.com but since my ssl cert is for www.example.com I get a warning what needs to be changed to add www and https if is not in the request?
I can add www here
RewriteRule . https://www.%{SERVER_NAME}%{REQUEST_URI} [L,R=301]
but I still need to figure out how to redirect to www to avoid the cert warning if the request was https://example.com