Eric
Eric

Reputation: 1061

How to point a domain to Aws S3 static website

I have my domain registered and hosted at Hostpapa.

I have my web hosting in AWS S3. All set up as below:

Created a bucket in AWS S3 (named myDomain.org for example) with all the website content uploaded. I'm able to access with URL like

http://myDOmain.org.s3-website.ca-central-1.amazonaws.com

The question is how do I point the domain in Hostpapa to AWS S3 website?

Thanks

Upvotes: 4

Views: 2483

Answers (2)

Eric
Eric

Reputation: 1061

It turns out straight forward.

In AWS S3

  1. Create 2 buckets
  1. Enable static web hosting in www bucket
  2. Configure redirect for myDomain.org bucket to www
  3. Upload website to www bucket
  4. Copy www url (also called CNAME) like www.myDomain.org.s3-website.ca-central-1.amazonaws.com

In Hostpapa (or whatever the domain register) Configure sub domain www to the above url (CNAME)

Wait couple of hours for propagation.

Works prefect!!!

Upvotes: 2

Chris Williams
Chris Williams

Reputation: 35146

The first thing to point out is that if you're trying to create a record for a root (or apex record) e.g. example.com you will need to ensure your domain service supports either ANAME or Alias records as traditionally only an A record (or AAAA for IPv6) will be supported for this record.

If your host supports one of these types (or is a subdomain e.g. subdomain.example.com in which case you can also use a CNAME record) you create the record and then use the CNAME provided as the value for your record.

If you are not able to configure in your current DNS provider, Route 53 does support Alias records so would be possible to add this for you.

Upvotes: 4

Related Questions