Search code examples
amazon-web-servicesamazon-s3hostingbucket

s3 static hosting display a list of the folder contents instead of index.html


I host a small page on s3 : http://artisants.maison-travaux.fr.s3-website-eu-west-1.amazonaws.com/

There is a domain name with a CNAME pointing on that bucket. When I go to the index.html url : http://artisants.maison-travaux.fr/index.html It works.

But the root of the bucket display a list of the bucket contents : http://artisants.maison-travaux.fr/

In the bucket configuration, I did add index.html as the index document. But it does not do the trick. Do I have to edit some redirection rule ?

It seems weird to me that it's not the default configuration.

I tried a redirect rule :

<RoutingRules>
    <RoutingRule>
        <Redirect>
            <Protocol>http</Protocol>
            <ReplaceKeyWith>index.html</ReplaceKeyWith>
            <HttpRedirectCode>301</HttpRedirectCode>
        </Redirect>
    </RoutingRule>
</RoutingRules>

That seems to have zero effect.


Solution

  • So, it appears that it's not really doable.

    The people in charge of managing the DNS have to make the CNAME point on the correct endpoint.