How to map a domain to an S3 bucket

To map a domain to an S3 bucket:

1. Choose a domain name, and on your registrar’s site, make it a CNAME for s3.amazonaws.com. For this example I’ve chosen static.reallysimple.org.

2. Using the AWS Management Console, create a bucket with the same name.

3. Store stuff in the new bucket. You can use the name defined in step 1 to refer to the contents of the bucket created in step 2. Here’s the url of a file in my bucket.

That’s all there is to it. It’s really simple. Amazon did this in a very straightforward and elegant way.

Why would you want to do this? It’s neater, and it gives you flexibility down the road if you want to move the content somewhere other than S3.

4 responses to this post.

  1. This is wonderful.
    I am going to try this when I get home.

    Reply

  2. Cool, Dave…thanks! It’s time for me to start using my S3 account in earnest and this helps immensely!

    Reply

  3. Dave,

    Are we allowed to ask semi-technical questions in here?

    Reply

  4. And it is better for SEO with regards to the structure of the urls. For example, with images, if you use S3 you can sometimes see in Google Image searches that the links to images will sometimes point to amazon as the location of the image if not done correctly. In our case since we sell images, it was important for our brand to be the url that searchers saw and not amazon.

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: