Friday, December 11, 2009

Amazon S3 - CName mappings

If you have tried using S3 to completely host your web service, you probably ran in to the index.html problem.

I came up with one solution, but my god it's not pretty.

First, your bucket must be called www.mysite.com if your web site is mysite.com.

You need to make two entries in your registrar's name server.

www CNAME www.mysite.com.s3.amazonaws.com
@ URL Redirect http://www.mysite.com/index.html

What will happen is that any URL that doesn't start with www will redirect to your index.html page, and all the pages under www.mysite.com will work correctly.

Ug. Comments?

No comments:

Post a Comment