Customizing Amazon S3 URLs With CNAME

In this Article the technique used for customizing S3 URL is fine but it is not the ideal method for delivery of your content using Amazon S3. Please refer How to Setup CloudFront as Content Delivery Network For S3

Go4Expert.com is showing signs of more powerful server requirement yet again and I am in process of looking for best server offers from ThePlanet but this time I have also started to move images on Amazon S3 specially article images but I wanted s3.amazonaws.com in the URLs to go but could not find any good article on the same but some information here and there and so thought I will share on how you can also go from

Go4Expert Logo

http://imgs.g4estatic.com.s3.amazonaws.com/banner.jpg

To

Go4Expert Logo

http://imgs.g4estatic.com/banner.jpg

With Amazon S3.

I assume that you have an Amazon S3 account and are aware of the process of creating buckets and uploading files to Amazon. If you are not sure of how to do it you can use S3Fox which is a very good Mozilla plug-in to manage your Amazon S3.

First create a bucket in Amazon S3 with exactly the same domain name / sub domain name. I wanted the URL to be imgs.g4estatic.com and so my bucket name in Amazon is also imgs.g4estatic.com.

Now go to your domain DNS. In my case g4estatic.com is registered at GoDaddy and so I go to DNS control for the Domain and setup a new CName for my domain i.e. imgs and target that to the bucket of Amazon s3 i.e. imgs.g4estatic.com.s3.amazonaws.com. Setting the target to s3.amazonaws.com also works but results in extra HTTP redirects.

Wait for the DNS to propagate but for new CName the change is instant. Now upload everything under the bucket and if you allow public read for the uploaded content you will be able to view your uploaded files in the browser.

Note: DNS names are case insensitive, but Amazon S3 can only have lower-case letters and so try to have everything in lower case only.

Sign up for Free Course on How to be an Online Entrepreneur?

Don't wanna sign up but prefer posts delivered to your Inbox?

Not planning to subscribe through Email. Check out the RSS Feed.

Comments

  1. says

    Sir, how are you?

    After very long time I came back to your website,

    I need your help in below cause.

    Now I have issue in my site, I am using https in my website because of Amazon CNAME my entire website does not working in https.

    I want revert to amazon cdn CNAME to Amazon own domain they having support in https in this cause I need your help how to changing my old CNAME fields to amazon own domains.

    My Cloudfront details:

    Domain Name: dtgxnog5a4zcn.cloudfront.net
    Origin Name : vookster.s3.amazonaws.com
    CNAME : cdn.vookster.com this is my current CNAME in Cloudfront setting please suggest me I need to change this to origin name in my Cloudfront setting or leave it as current setting.

    This is my Amazon s3 original path:
    https://s3-ap-southeast-1.amazonaws.com/vookster/file/pic/user/1.png

    My Amazon s3 bucket name is (vookster)

    I want use Amazon cdn https feature in my site with their own domain like this: https://s3-ap-southeast-1.amazonaws.com/vookster/file/pic/user/1.png

    Please suggest me how to proceed to setup Amazon s3 own domain with https feature.

    Regards
    Vookster

  2. Ray says

    Hi, I am following your advice but seems could not succeed..

    I want the following
    http://liangpai.s3.amazonaws.com/uploadImage/shareImage/2012-10/506dc1ef71dcf.png

    showing as:

    http://imgs.liangpai.me/uploadImage/shareImage/2012-10/506dc1ef71dcf.png

    My S3 bucket name is “liangpai”. On Route 53, I created a new CNAME named “imgs”, the value I entered for it is “liangpai.s3.amazonaws.com”

    After this I don’t see http://imgs.liangpai.me/uploadImage/shareImage/2012-10/506dc1ef71dcf.png

    Can you help?

    Thanks!
    Ray

  3. says

    Thanks lot mere bai it’s success now my website is live with amazon S3 with Cloudfront

    do you any internet marketing idea that promot the new sites. etc email marketing, seo, backlinks

    Regards
    Laxmana Rao

  4. says

    Thanks for you repl

    ok i have setup new bucket as well as cloudfront now my two url working but CName url not working what is the prolem> working urls:
    http://vookster.s3.amazonaws.com/Flower.gif
    http://s3.amazonaws.com/vookster/Flower.gif
    Notworking Cname url is:
    http://cdn.vookster.com/
    http://www.cdn.vookster.com.s3.amazonaws.com/vookster/Flower.gif

    I have add my Cname under my Hosting not in Name.com
    look like this cdn.vookster.com 14400 IN CNAME dtgxnog5a4zcn.cloudfront.net.vookster.com. (last dot automatically add)

  5. says

    Hellow Sir,

    Iam new for Amazon S3. I did’t understanding how to setup S3 with ColudFront for my site.

    I register my domain name with Name.com, they saying if you want work the DNS service you should enable our name server without that we are not able to help or ask hosting provider they said.

    What have do I don’t undestand

    iam using for vookster.com script phpfox i ask they also but thier side also no good response please help me to resolve this issue.

    for setup S3 backet as well as cloudfront for my site.

    Status : Waiting for your reply

    Regards
    Laxmana Rao G

    • says

      Hi Laxmana,

      Let us take one step at a time.

      You have your Amazon S3 bucket setup done and so you should be able to browse through your publicly uploaded images like mine here

      http://imgs.g4estatic.com.s3.amazonaws.com/banner.jpg

      http://vooksterusercontent.vookster.com.vooksterusercontent.s3.amazonaws.com/banner.jpg

      Once this is done you should be able to convert Amazon url to your domain url by creating the CName for

      vooksterusercontent and add the answer as vooksterusercontent.vookster.com.vooksterusercontent.s3.amazonaws.com

      This is all you need and I am not sure what else is required.

      I have few domains in name.com and I have done the same. cdn.imtips.in is what I use here at imtips.co and it works fine in name.com

      • says

        Thanks for help brother.

        I have setup s3 backet again now two url i can access but CName url not configure well i think. both url is :http://vookster.s3.amazonaws.com/Flower.gif
        http://s3.amazonaws.com/vookster/Flower.gif

        my CName i used as cdn.vookster.com

        I Added DNS CName at my hosting screen shoot http://www.chatfriendz.com/cek.jpg
        but my name.com support say below issue for updating Cname at Name.com :
        Original MS from NAME.com
        Hello,

        The DNS records can only be managed with whoever you have the Name-servers pointed to. In this case your name-servers are pointed to:

        ns1.chatfriendz.com
        ns2.chatfriendz.com

        And therefor you would have to setup the DNS records there.

        If you want to be able to manage your DNS records with us, you would have to use our name-servers. However, if you change your name-servers to our name-servers you would have to setup the DNS records from within to point to your hosting. We can assist you with this, but you would have to obtain the DNS records from your hosting provider in order for us to set them up. If you have any additional questions or concerns, certainly let us know. We would be happy to provide further assistance.

        Regards,

        Henrik
        ——————————–

        Regards
        Laxmana Rao Gedala

  6. says

    First of all Thank you very much for valuable time spend on my issue

    I typed cname field Bucket in S3 as: vooksterusercontent
    so url Cloud Front Generote
    CNAMEs:vooksterusercontent.vookster.com
    Origin Bucket: vooksterusercontent.s3.amazonaws.com

    what should I use in record answer field, the both url look like this : vooksterusercontent.vookster.com.vooksterusercontent.s3.amazonaws.com

    regards
    Laxmana Rao

  7. says

    HI shabbir,
    Thanks for the great post. Does this also work for zip files? I have been looking for solutions on my product delivery with amazon s3.

    thanks,
    louie

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>