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
demandé il y a 4 ans2510 vues
2 réponses
0
répondu il y a 4 ans
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
répondu il y a 4 ans

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions