Create CloudFront distribution

  1. Open Amazon CloudFront console. Then click Create distribution CreateDistribution

  2. Select the origin domain is fcj-book-shop bucket CreateDistribution

  3. Select Legacy access identities to just allow access to the S3 bucket from CloudFront

    • Click Create new OAI CreateDistribution

    • Click Create CreateDistribution

    • Select OAI you just created

    • Select Yes, update the bucket policy CreateDistribution

  4. Scroll down, in Default cache behavior section, select Redirect HTTP to HTTPS for Viewer protocol policy CreateDistribution

  5. Scroll down, in Settings section, click Add item

    • Enter CNAME: www.fcjbookshop.click and fcjbookshop.click
    • Select the SSL certificate you created in previous step CreateDistribution
  6. Scroll down to bottom, enter index.html for Default root object pattern

    • Click Create distribution CreateDistribution
  7. Go back to the Route 53 console

    • Click Create record CreateRecord
  8. Enter www for Record name

    • Turn on Alias
    • Select Alias to CloudFront distribution
    • Click Create records CreateRecord
  9. The record have created CreateRecord

  10. Enter the following links in a new tab in your web browser: http://DOMAIN, http://www.DOMAIN, replace all DOMAIN with your domain name. All those links redirect to the new path, replace http with https CreateRecord