Amazon s3 has recently announced that Amazon S3, one of the cheapest cloud storage service has started offering support for root domains. In simple terms, Amazon s3 can now be used to host a full fledged static website.
Previously, web developers and owners had to use some tedious methods to achieve this, as S3 did not offer the support out-of-the-box. They needed to run a web server to proxy root domain requests from browsers to your website on S3, but with root domain support launch, it is extremely easy and straight forward.
This is really a big deal, because Amazon s3 is one of the cheapest and best file storage service available on the web and now with addition of root domain support, millions of website owners can take advantage of it. The cost works out to be fraction of what traditional web hosting companies might be charging.
How to Setup Amazon S3 Root Domain
Before you get started, you need to make sure that you have a Domain name registered in your name. You will also need an Amazon S3 and Amazon Route 53 account registered.
Once you have these 3 pre-requisites in place, follow these simple steps:
1. Create an S3 bucket with the same name as your “www” subdomain (e.g. “www.domainname.com”). This is the bucket where your web content will be kept. Within the “Static Website Hosting” tab, choose “Website hosting enabled”. You can refer to Amazon documentation to configure website hosting for a bucket and then Click “Save.”
2. Create another S3 bucket with the same name as your root domain (e.g. “domainname.com”). Within the “Static Website Hosting” tab, choose “Redirect all requests to another host name”. In the input box, enter the name of your “www” subdomain (e.g. “www.domainname.com”) and click “Save.” This ensures that end users that access your website by typing “example.com” will be redirected to content in your “www” subdomain bucket.
3. Register your DNS with Amazon Route 53. Within the Amazon Route 53 Management Console, create a new hosted zone for your root domain (e.g. “domainname.com”). Create a new record set of Type “A – Ipv4 address.” Select “Yes” for Alias and then choose the value that corresponds to your root domain name.
Refer to Amazon full documentation for more information on setting DNS records and using Route 53.
If you are one who has gone through and setup the website on Amazong S3, do let us know your experience and how east and difficult it was to setup the same!