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 年前2505 查看次数
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 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则