vishalkohli
vishalkohli

Reputation: 97

How do I configure CNAME for S3 websites

I am trying to host my static website using S3. I have a domain that I bought outside of AWS. The URL for my bucker http://my-website.com.s3-website-us-east-1.amazonaws.com. My domain name is my-website.com. I have tried everything but I cannot wrap my head around how I should be configuring CNAME so that my URL does not look messed up. I tried forwarding but that does not work for obvious reasons.

Please suggest solutions.

Upvotes: 1

Views: 272

Answers (1)

Radu Diță
Radu Diță

Reputation: 14201

It depends on what your DNS provider is

  1. You're using Route53 then you need to go to the Hosted Zone for my-website.com and add a A record for my-website.com that points to the bucket. You must set Alias to true for this to work.
  2. If you're using a different DNS provider you can't route Apex domain (my-wesite.com, without www, or another subdomain in front). You'll be able to add a CNAME record for a subdomain that points to the S3 web endpoint.

Upvotes: 1

Related Questions