Help with S3 redirect

1

I am creating my first website.

I have example.com registered and setup as an S3 bucket and it works fine. I would like to make it so www.example.com redirects to example.com.

I set this up as described in AWS documents and it worked fine for a while - but then at some point www.example.com stopped working. I just get a message the browser cannot find the server.

Originally I was trying to do this with CloudFront and I thought perhaps some old CloudFront stuff had conflicted. I deleted all the CloudFront entries I had.

I have the second www.example.com S3 bucket setup as Hosting Type: Redirect Request and the endpoint link works fine if I use it directly.

In Route S3 I added the Type A simple record to www.example.com hosted zone and it routes to: s3-website-us-east-1.amazonaws.com.

It's perplexing because it worked fine for a few days and then stopped working. I have tried deleting and recreating buckets so perhaps I have done something incorrectly in the process.

I don't mind sharing the domain name but I am not sure if that is good forum protocol. Thank you for any advice on how to debug this.

zaphara
asked 2 years ago604 views
3 Answers
1
Accepted Answer

Some more troubleshooting is required here:

First, make sure that the DNS (Route 53) is set up correctly. From a command-line prompt, use nslookup or dig to ensure that the www.example.com record is available. Even something like ping www.example.com is fine - you want to make sure that it returns an IP address.

Second, do the same thing with example.com.

Then, check the redirect configuration in S3 for www.example.com.

I wouldn't suggest sharing private information in this forum; if you're still having difficulty definitely raise a ticket with the support team as they some visibility into how you've configured the services and can help from there.

profile pictureAWS
EXPERT
answered 2 years ago
0

Thank you for responding.

I have confirmed that ping www.example.com fails - while ping example.com is fine.

I am not certain if this means the redirect configuration should still be investigated, or does this mean the problem is definitely happening earlier such as in the Route S3 setup where I have the www.example.com hosted zone? I appreciate your clarification.

I have inquired with Tech earlier but I am on the free account so they suggested I use the forums. They pointed me to the docs for setting up S3 redirect which did work at first. It worked fine for a few days then stopped working without any changes to my AWS setup. I assumed something I did was pending and updated after a few days to break it.

zaphara
answered 2 years ago
0

Thank you. I have resolved this.

You response led me to look back at my Route S3 - realized at some point trying to get CloudFront to work I had added a second hosted zone for www.example.com. The correct solution after reviewing the docs was to have a single hosted zone example.com and add the record for www.example.com. It is now working for me.

zaphara
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions