Customize your Amazon S3 Url

11 Feb
2009

Amazon s3I see a lot of sites still using the long default Amazon S3 url so I thought this might be helpful to someone. Lets say I setup a bucket for images on this domain at images.wrichards.com.s3.amazonaws.com to serve all my images. I don’t really want to type out the extra s3.amazonaws.com bit everytime I link to an image. :P There is a quick and easy solution to change your domain with CNAME:

images.wrichards.com CNAME images.wrichards.com.s3.amazonaws.com

Just add a CNAME record with that information and you should be good to go (obviously change my domain to yours). You can add your CNAME in your DNS entry More Info here. I can now access my bucket via the custom domain images.wrichards.com.The bucket name must match and be lowercase for this to work properly.

3 Responses to Customize your Amazon S3 Url

Avatar

Aaron Schmidt

March 24th, 2009 at 1:07 pm

Hi,

Will the following work?

images.example.com CNAME
example.s3.amazonaws.com

I.e. does the bucket name have to match the full domain name?

Avatar

Bill

March 24th, 2009 at 7:10 pm

Hi Aaron,

Unfortunately, the bucket name has to match the full domain. So in your case:

images.example.com CNAME
images.example.com.s3.amazonaws.com

Avatar

Khal

January 5th, 2010 at 10:08 am

Hi

I tried doing this. Took a few attempts .. but got it working.. both this post and this post

http://carltonbale.com/how-to-alias-a-domain-name-or-sub-domain-to-amazon-s3

were never clear on things.. let me give it a shot for people who get stuck..

You want your url like

http://superman.site.com/

Or

http://coolservername.site.com/

agreed?

Good..

1) Create your subdomain on your domain Cpanel folder.

For this example, I own test.com and the subdomain I created is batman.test.com

2) Open Cloud Explorer (free amazon s3 kit) and create your bucket.. this is the important part..

your bucket name must be your entire subdomain name

So create
“batman.test.com” as a bucket and not “batman”

NOW you can follow the rest of these tutorials

3) Your name should be a new CNAME entry for your domain. For my example of batman.test.com, the entry was:

* Name: batman
* Type: CNAME
* Value: s3.amazonaws.com.
* (If you are an European users, use s3-external-3.amazonaws.com. instead)

Thats it!

http://test.batman.com/loads/bucket/subfolders/logo.png

Enjoy!!

Comment Form

top