DEV Community

Discussion on: Migrating from Lambda@Edge to CloudFront Functions

jimmydqv profile image
Jimmy Dahlqvist Author

There is actually a index.html file present under /path/ . Since links in my blog, consisting of static generated files, points to /path/ and not to /path/index.html CloudFront will request the /path/ from S3, CloudFront doesn't "speak" web server. Since there is no file in S3 called /path/ it will end up with an 404 error. Therefore the Lambda rewrites the path and append index.html so the correct file is requested from S3.
So either I have change all links to point to the actual index.html file or use a Lambda@Edge to do it for me.

wparad profile image
Warren Parad

that's exactly my point, create a file called /path/ problem solved.