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 年前檢視次數 2493 次
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 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南