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
질문됨 2년 전682회 조회
3개 답변
1
수락된 답변

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
전문가
답변함 2년 전
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
답변함 2년 전
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
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠