-
Create two S3 bucket with your domain name
(www and non-www)
- example.com
- www.example.com
-
Configure
non-www
bucket to redirect towww
bucket
-
Upload your web content to www bucket
-
Configure www bucket for web-hosting by selecting
static website hosting
- Make www bucket as
public
and add the belowpolicy
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect":"Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::www.example.com/*"
}
]
}
-
Create AWS route53 public hosted zone with the same name as the domain name (Non-WWW).
-
Update GoDaddy NS with AWS provided NS (without ending dot(.).
-
In AWS Route53
create
A Type
recordset for thenon-www
domain and select- Alias to S3 website endpoint,
- Select the region of your bucket
- Select your
S3 main bucket
(i.e non-www domain)
create
A Type
recordset forwww
subdomain and repeat the above steps/points except the selecting S3www
bucket.
- Access your web site from browser. Enjoy