title: s3 static site + cloudfront + SSL not working for non www
body: <p>I have a static html site hosted on a s3 bucket. I have generated a free ssl certificate with let's encrypt which I imported into ACM. </p>
  
  <pre><code>certbot --manual --server https://acme-v01.api.letsencrypt.org/directory -d example.com -d www.example.com
  </code></pre>
  
  <p>I have setup cloudfront to use that certificate.</p>
  
  <p>On my DNS provider (namecheap) I have set a CNAME that points www to the  cloudfront domain name, and also put a redirect from mydomain.com to www.mydomain.com</p>
  
  <p>Now if I go to </p>
  
  <p><a href="https://www.example.com" rel="nofollow noreferrer">https://www.example.com</a>, it works </p>
  
  <p><a href="https://example.com" rel="nofollow noreferrer">https://example.com</a>, it hangs until it times out </p>
  
  <p>Can someone tell me what I'm a missing ?</p>