2

I'm learning some web development and am using Amazon S3 as a web host with a custom domain from Google domains. I used the guides from the Amazon AWS page and was able to set up the web page but I have a problem with getting the custom domain to work.

For example, Amazon S3 has the endpoint URL to www.example.com.s3-website-us-east-1.amazonaws.com and I want my domain example.com to show up. When I load the page for www.example.com, it loads the page however it still shows the example.s3-website-us-east-1.amazonaws.com when I want it to show the simple example.com instead.

From what I can tell, I need a CNAME, I've set it up as www.example.com -> www.example.com.s3-website-us-east-1.amazonaws.com with permanent redirect (301) and forward path.

Please help!

7
  • Check the setup on the www bucket. "Redirect all requests to another hostname" should say "example.com" -- not the endpoint for the example.com bucket. Nov 10, 2016 at 3:53
  • Did you follow the directions on Setting Up a Static Website Using a Custom Domain? Specifically, is your bucket name set to your domain name? Nov 10, 2016 at 5:53
  • @John Rotenstein Yes that is what I followed, I have www.example.com and example.com as a bucket as well. I don't have any Route 53 set up though, and I'm not sure if it's required in this case?
    – Tenza
    Nov 10, 2016 at 17:42
  • @Michael - sqlbot I have changed my www bucket to now redirect all requests to example.com instead of the endpoint. I'm not sure if it will be of any help, but the site in question is khatri.cc
    – Tenza
    Nov 10, 2016 at 17:46
  • It looks like you are using S3 behind Cloudflare. The site seems to be working correctly. Nov 10, 2016 at 20:25

2 Answers 2

2

If anyone was wondering how I got it to work, I ended up using Cloudflare with its free DNS options. I added the DNS servers to google domains and then added two CNAMES:

@ -> example.com -> example.com.s3-website-us-east-1.amazonaws.com (for the root)

CNAME -> www -> www.example.com.s3-website-us-east-1.amazonaws.com (for the www redirect)
0

On the Google side, configure the CNAME record (www) to point to s3.amazonaws.com. (yes, the dot included) ... like this:

enter image description here

... and wait a few minutes.

Make sure your S3 bucket is named: www.yourdomain.com

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.