- Newest
- Most votes
- Most comments
Hello.
I have some new requirements such that if the path is test123.com/v2/ or test123.com/v2/anything it should give me the /v2/index.html from the same bucket.
CloudFront sends the actually entered path to the origin (S3), so you need to access it in the browser as follows.
https://test123.com/v2/index.html
If you want to omit the file name index.html, you need to use a feature called CloudFront Function as described in the document below.
https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/example-function-add-index.html
By the way, you don't need to use static website hosting when using S3 as your CloudFront origin.
As shown in the document below, it is possible to distribute web content while restricting access using a function called OAC.
https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-restricting-access-to-s3.html
Relevant content
- Accepted Answerasked 2 years ago
- AWS OFFICIALUpdated 20 days ago
- AWS OFFICIALUpdated 2 months ago
- AWS OFFICIALUpdated a year ago