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 www.<your_domain>
to <your_domain>
.
Regarding redirect, this section describes from www.hashnao.info to hashnao.info.
Make sure that you meet the following requirements:
- Request and register your domain name...