Why isn't CloudFront returning my default root object from a subdirectory?
Last updated: 2021-11-24
Why isn't Amazon CloudFront returning my default root object from a subfolder or subdirectory?
The default root object feature for CloudFront 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 Lambda@Edge Pricing.