Configure AWS Cloudfront Path Pattern workaround for Regular Expression

amazon-cloudfrontamazon-web-services

From what it appears, Cloudfront Path Pattern doesn't support complete regex.

enter image description here

What I want to achieve is to separate the requests /[a-z]* from the requests /[a-z]/.+ to different origins.

So, a request /page must have a different behavior from /page/something. And I can't seem to figure out a way of doing this.

Best Answer

Put /*/* earlier in the path order (lower sequence number) and /* later in the list.

CloudFront uses first match, not best match and /*/* won't match anything without at least one slash in the middle of the path. Of course, the default behavior may make the second entry unnecessary.