• Skip to primary navigation
  • Skip to main content
Sal Ferrarello
  • About Sal Ferrarello
  • Speaking
  • Connect
    Mastodon GitHub Twitter (inactive)
You are here: Home / Dev Tips / Custom URL for S3 Bucket

Custom URL for S3 Bucket

Last updated on May 28, 2014 by Sal Ferrarello

My goal is to setup a custom url, in this case static.ironcodestudio.com, to pull directly from an S3 bucket.

Create the Bucket

Create the bucket with the name matching the url where you’ll load the file. In my case, I named the bucket static.ironcodestudio.com

For the Region, I recommend US Standard.

Make the Bucket Publicly Accessible

Go to the bucket Properties and choose Static Website Hosting.
Select Enable website hosting
Set Index Document to index.html
Set Error Document to index.html
Take note of the endpoint, in my case it is static.ironcodestudio.com.s3-website-us-east-1.amazonaws.com
Publicly Accessible S3 Bucket Settings

Upload the Files

Upload an index.html file to display if a matching file is not found. You can view the source of my file at
view-source:http://static.ironcodestudio.com.s3-website-us-east-1.amazonaws.com/
and make the file public.
Make S3 File Public

Setup the Custom URL

Remember, the custom URL should match the S3 bucket name.
Within your DNS settings on your name server, create a CNAME for your custom url static.ironcodestudio.com that points to the endpoint you record above static.ironcodestudio.com.s3-website-us-east-1.amazonaws.com
You’ll need to give time for the DNS to propagate but then going to your custom url static.ironcodestudio.com should display the index.html file you created.
Custom Url S3 Bucket DNS

Additional Files

When uploading additional files, remember to make them public as well.

photo credit: peasap via photopin cc

Sal Ferrarello
Sal Ferrarello (@salcode)
Sal is a PHP developer with a focus on the WordPress platform. He is a conference speaker with a background including Piano Player, Radio DJ, Magician/Juggler, Beach Photographer, and High School Math Teacher. Sal can be found professionally at WebDevStudios, where he works as a senior backend engineer.

Share this post:

Share on TwitterShare on FacebookShare on LinkedInShare on EmailShare on Reddit

Filed Under: Dev Tips Tagged With: AWS

Reader Interactions

Leave a Reply Cancel reply

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

Copyright © 2023 · Bootstrap4 Genesis on Genesis Framework · WordPress · Log in