S3 Website Redirect

0

I have successfully created S3 re-directs for a www and nonwww however to achieve this I have had to creat two S3 buckets one with www.domain.com and one without domain.com. My question is, is it possible to do this with just one S3 bucket?

Thanks in advance!

질문됨 2년 전245회 조회
2개 답변
1

You will need to front the one bucket with a CloudFront distribution and have both example.com and www.example.com point, via a Route 53 Alias, to the distribution. You get the added benefits of being able to serve up HTTPS (with free ACM certificate), it does not matter what your bucket is named, and you don't need to make your bucket public. Plus it may save some money, AWS price reduction for data transfers out to the internet

profile pictureAWS
전문가
kentrad
답변함 2년 전
0

What kentrad mentioned is of course valid but it will just serve your page from both addresses

I assume that you want to always redirect non www domain to www domain.

Then to achieve it you can follow kentrad advice, but you need two CloudFront distributions.

It can be achieved with one CloudFront distribution, but it will increase the amount of invocations of CloudFront Function. This implementation is described here.

profile picture
MG
답변함 2년 전
  • OK I have this exact issue described here in this new question. I rewrote it in this new question because the old question does not elaborate on the situation enough. and there is nearly zero information out there about this problem. here is my new question: repost.aws/questions/QUGfaD2IwsTuirmrDTrQ6JEg/is-there-a-way-to-not-have-2-cloudfront-distributions-for-the-1-website-www-base-domains

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

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

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

관련 콘텐츠