简体   繁体   中英

CloudFront - serve different object based on path pattern

I'm serving a static webpage using S3/Cloudfront.

I would like to serve different html based on path pattern:

example.com/dashboard -> app.html
example.com/profile -> app.html
example.com/homepage -> homepage.html
example.com/marketing -> homepage.html

I know that you can set a 'Default Root Object' in cloudfront, but I was wondering if you would serve different object based on path patterns.

This isn't currently supported as written, but in an S3 bucket with web site hosting enabled, requesting /homepage or /homepage/ will automatically render the object at homepage/index.html if you set the Index Document for the bucket as index.html .

Lambda@Edge should be able to do this it, once that service leaves prievew mode.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM