Sunday, July 04, 2010

how to use your own domain name to point to Amazon S3 content

If you use S3 to store content viewable on the web, it may make sense to keep your options open, for a possible switch to a different provider later on, if need be, that wouldn't result in broken links.

To do that you need to control the URL of your content, the full URL, including the host name, hence its full domain. I've been looking for a solution to this problem and I found an excellent post.

The gist is to create a subdomain for your content, e.g. and map that subdomain through a CNAME DNS record to the Amazon's S3 domain. The essential thing is to have the name of your S3 bucket containing your content match exactly the name of your subdomain, that is, your bucket name for our example should be "".

The post above mentions adding a trailing dot at the end of Amazon's domain. I guess that's dependent on your domain management console. In my case I'm using Godaddy's tools and found that trailing dot not necessary.

No comments: