I have a domain (example.com) with SSL support. I am having an issue when trying to redirect a request from www.example.com
-> https://example.com
.
The error I get when trying to access www.example.com is:
The request could not be satisfied.
Bad request.
These URLs work (redirect to https://example.com
)
example.com
http://example.com
https://example.com
http://www.example.com
shows that the website is not secure, meaning it does not use the certificate.
S3
I have created 2 S3 buckets example.com & www.example.com (A and B, respectively). Bucket A's Static Website Hosting has enable website hosting pointing to example.com. Bucket B's Static Website Hosting has redirect all requests to example.com.
Cloudfront
I have a distribution with 2 Alternate Domain Names (CNAMEs), example.com and www.example.com. I also have an SSL cert on this dist.
Route 53
I have a hosted zone with 2 A-type aliases, example.com and www.example.com that both point to Cloudfront's distribution (XX.cloudfront.net)