- Newest
- Most votes
- Most comments
Many browsers today will add www. to your domain when you enter just the domain.com. That may be why the domain.com works when you do HTTP:// but not when you do https://.
You can validate this by using curl command like so:
curl HTTP://example.com
If it returns an error, then this is probably what is happening.
You can follow this tutorial and you can then redirect all HTTP and https traffic for example.com and www.example.com to your S3 bucket as you like.
Hope this helps!
Thanks for the help Carlos.
Good call! Yes, it appears the browser was adding www. curl works for www but not the root domain, which makes sense now.
I looked at that link and still being very new to AWS, is there another tutorial that instead uses CloudFront? I'm a bit concerned on the potential cost of all these services just to host a static website when my trail runs out.
I've many many posts that suggest I can redirect root domain to www using an A record alias that points to the CF distro url using Route53 but I have not been able to get that to work.
Unfortunately Route 53 does not allow CNAMEs for the apex of the domain. You would have to use a service like redirect.pizza which can do that for you for free.
Relevant content
- Accepted Answerasked a year ago
- AWS OFFICIALUpdated 10 months ago
- AWS OFFICIALUpdated 3 months ago
- AWS OFFICIALUpdated 2 months ago
- AWS OFFICIALUpdated 2 years ago
You could look at a similar question I asked here https://repost.aws/questions/QUlgzwFY2HSoy3y0w26X2ruw/https-response-times-out-http-delivers-content-though