Similarly to other stacks, I have hosted a website using AWS services:
- Registered domain on Route 53 (example.net)
- Content is hosted on an S3 bucket
- Got an SSL certificate using AWS Certificate Manager
- Created a CloudFront distribution, pointed it to S3 and connected it to my domain with Route 53.
All of this works except for an issue at what seems to be the final hurdle. When I enter my domain url into the search bar, example.net, the connection isn't secure by default. I've illustrated the problem here.
I'm relatively new to hosting and can't find a solution relating to this. My thoughts are that I'm missing some Cloudfront or Route 53 configuration, since another thing that doesn't work is connecting via www (I don't care about that issue as much). Any input is appreciated.
CodePudding user response:
By default enabling HTTPS on a website doesn't disable HTTP. They are both available, on separate ports. That's why you have to type https://
in the browser's address bar to go directly to the HTTPS version of your website. You can get CloudFront to redirect all HTTP requests to HTTPS by following this guide.