Static bucket redirect requests append index.html to homepage URL

0

Hi, I'm hosting a static website (www) on an S3 bucket and I created another S3 bucket (without www) which redirects all requests to the "www" bucket. Both have been assigned to specific CloudFront distributions and everything works perfectly. The only issue I noticed is that when I access the site using the non-www version, I get correctly redirected to the www version, but "index.html" gets appended to the URL (this only happens on the homepage). Is there any workaround that would allow me to remove the "index.html" from the URL? Thanks!

colis
질문됨 4년 전2414회 조회
2개 답변
0
답변함 4년 전
0

Hi awshakan,

thanks for getting back to me and also for pointing me in the right direction.

It was indeed an issue with the Default Root Object setting on CloudFront. Basically, the default root object setting needs to be blank on the CloudFront distribution that gets used for redirecting the requests, whereas it only needs to be set (in my case "index.html") on the CloudFront distribution that points to the S3 bucket containing the actual content of the site.

colis
답변함 4년 전

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

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

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