How to configure a static website using a custom domain

In the How to configure a static website on Amazon S3 bucket recipe, we created a static website on Amazon S3 bucket and we can access the website through a website endpoint. However, most of the customers want to use your custom domain for your website such as http://<your-blog-site>.com/ or http://www.<your-blog-site>.com/. In order to use a custom domain, we need to create two S3 buckets, configure a website redirect, and use Route 53 for creating a DNS record.

Getting ready

We hosted a static website on Amazon S3. Then, let's configure a static website using your custom domain.

We use two buckets to allow access for both http://www.<your_domain>/ and http://<your_domain> by redirecting from ...

Get Amazon S3 Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.