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 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 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


Go4Expert Logo

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 and so my bucket name in Amazon is also

Now go to your domain DNS. In my case 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. Setting the target to 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.

  • Laxmana Rao

    Thank you for your reply,

    Simple Question is:

    How to run Amazon S3 with their own domain without Required CNAME etc: or

    I am running HTTPS supporting website for security reason, with custom CNAME HTTPS will not work as you know that.

    Please suggest me how to configure this in cloudfront as well as in my site.

    Laxmana Rao G

  • Laxmana Rao

    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:
    Origin Name :
    CNAME : 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:

    My Amazon s3 bucket name is (vookster)

    I want use Amazon cdn https feature in my site with their own domain like this:

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


  • Kanasu


    Bucket Name –

    CNAME(BigRock) :
    Name –
    Value –

    I’ve a file in my bucket. It works in

    but not at

    It gives a 404 ” File or directory not found”


    • Shabbir

      Kanasu, CName name should not be but only img. It may vary from your DNS interface though but ideally it should be only the first part of your domain.

      • Kanasu

        I know. I’ve created two CNAMEs. One with just img and the other with http://www.img

        Still, it’s not working.

        • Shabbir

          Kanasu, can you share your exact domain because there is no reason for not working.

  • Ray

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

    I want the following

    showing as:

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

    After this I don’t see

    Can you help?


    • Shabbir

      Ray, your bucket in Amazon S3 should be exactly the same domain name / sub domain name.

  • Ray

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

    I want the following

    showing as:

    My S3

  • Soroush Pour

    Great stuff, this was pretty annoying until I read this and figured it out, thanks Shabbir

    • Shabbir

      The pleasure is all mine Soroush

  • Laxmana Rao

    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

    Laxmana Rao

    • Shabbir

      Laxmana Read the following Traffic Tips.

  • Laxmana Rao

    ok I contact my host provider they said Subdomain of CName working fine but why I accessing it. it’s not showing Flower.gif image it’s giving error below:
    NoSuchBucketThe specified bucket does not existcdn.vookster.com5BAE85CCE9E1CC87FboJyJ3hGwt5mbfqDZKkGbbA7bqv2Cu8R/4CLteJ4Na1XxeRQT2zs7nmBNGT1KLZ

    the url i try to access the s3 backet
    brother what you think problem where ?

    • Shabbir

      Your files are not access to public.

  • Laxmana Rao

    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:
    Notworking Cname url is:

    I have add my Cname under my Hosting not in
    look like this 14400 IN CNAME (last dot automatically add)

    • Shabbir

      The CName answer for cloudfront should be only and nothing more.

      • Laxmana Rao

        when add new Cname under my DNS Management that time I am not enter anything after cloudfront url after again I login to DNS manager it showing look like this

        • Shabbir

          May be WHM is doing something.

  • Laxmana Rao

    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, 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 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

    Laxmana Rao G

    • Shabbir

      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

      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

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

      I have few domains in and I have done the same. is what I use here at and it works fine in

      • Laxmana Rao

        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 :

        my CName i used as

        I Added DNS CName at my hosting screen shoot
        but my support say below issue for updating Cname at :
        Original MS from

        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:

        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.



        Laxmana Rao Gedala

        • Shabbir

          If does not manage your DNS you should be doing it where you have it managed.

  • Laxmana Rao

    can please tell how complete setup my CDN on my site
    please have look url

  • Laxmana Rao

    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
    Origin Bucket:

    what should I use in record answer field, the both url look like this :

    Laxmana Rao

    • Shabbir

      You have made the simple things complex. CName answer should be your Origin bucket.

  • Laxmana Rao

    hellow Shabbir!

    I would like create cname for my domain for amazon s3
    I registered by domain with when I enter my CName showing error asking to type (Record Answer) please tell me how could I resolve this issue.

    I have screen shoot for the error shows in my dns field

    Laxmana Rao

    • Shabbir

      Record answer should be your Amazon S3 bucket name in my case it was

      Ideally you should be using Cloudfront for delivering your S3 data. See

  • AdrianTeoYC

    Thanks for this tip on aws :)

    • Shabbir

      The pleasure is all mine. 😀

  • louie

    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.


    • Shabbir

      Yes it is independent of the type of files.

      • louie

        Thanks for that quick response. Do I need to use subdomain or can I just use a folder in a bucket. i.e.
        Sorry to bother you so much.Thanks in advance.

        • Shabbir

          Louie, you can use the S3 bucket but using S3 for downloading means more cost and if you can use the Cloudfront for distribution can reduce your cost considerably. See

        • Shabbir

          You don’t need any sub-domains and can use Amazon URIs directly