Why isn't CloudFront returning my default root object from a subdirectory?

1 minute read

I want to know why Amazon CloudFront doesn't return my default root object from a subfolder or subdirectory.


The CloudFront default root object feature supports only the root of the origin that your distribution points to.

CloudFront doesn't return default root objects in subdirectories. For more information, see Specifying a default root object.

If your CloudFront distribution must return the default root object from a subfolder or subdirectory, then you can integrate Lambda@Edge with your distribution. For an example configuration, see Implementing default directory indexes in Amazon S3 backed Amazon CloudFront origins using Lambda@Edge.

Important: You are charged an additional fee when you use Lambda@Edge. For more information, see AWS Lambda pricing.

Related information

Configuring an index document

AWS OFFICIALUpdated 9 months ago