Migrate from Blogger to Hugo and host in AWS using S3, CloudFront, Certificate Manager and Route 53
I have been hosting my blog in Google Blogger for a long time, It is still one of the easy ways to host blogs without …
In this article we will see the steps to redirect naked domain to full domain in AWS. A naked domain is a domain name server (DNS) name that can’t be a canonical name record (CNAME). An example is entechlog.com, without the “www” subdomain. When you create a website which is hosted in S3, CloudFront and Route 53 your naked domain does not get redirected to full domain automatically. To redirect, you need to follow below steps
Target bucket or domain
with the full domain name www.example.com
Endpoint
and validate redirection is happening as expectedBlock all public access
is ‘On’ since we don’t need any kind of public access to this bucketCopy the endpoint from static webhosting and use it to create a new CloudFront distribution. Remember here “Origin Domain Name” should the endpoint from static webhosting of s3 and not the s3 bucket itself
Select Redirect HTTP to HTTPS
in Viewer Protocol Policy
Select Yes
in Compress Objects Automatically
Fill Alternate Domain Names (CNAMEs)
with naked domain name example.com
Select Custom SSL Certificate (example.com):
in SSL Certificate and select the certificate which was created for your domain
Fill Comment
with naked domain name example.com
Click Create Distribution
After CloudFront distribution creation is complete, Copy the Domain Name
from CloudFront distribution
Go to Route 53 –> Click Hosted zones –> Click the Hosted zone which we created
Add a record set for the naked domain name example.com
Name | www |
---|---|
Type | A |
Alias | Yes |
Alias Target | Domain name from CloudFront distribution |
Routing Policy | Simple |
Evaluate Target Health | No |
Now you should be able to access your website using naked domain example.com also. Please note DNS changes will take a few minutes to get reflected.
I have been hosting my blog in Google Blogger for a long time, It is still one of the easy ways to host blogs without …
In this article we will see the steps to connect your custom google domain with AWS Route 53. This article was written …