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, 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'll be charged an additional fee when you use Lambda@Edge. For more information, see Lambda@Edge Pricing Details.


Did this page help you? Yes | No

Back to the AWS Support Knowledge Center

Need help? Visit the AWS Support Center

Published: 2018-04-02

Updated: 2019-03-19