Add parameter to CloudFront URL and access it over custom domain

0

Hey,

I have a specific problem: I have a CloudFront distribution which gets content from a S3 Bucket. The bucket has two folders: manual with subfolders and factsheet with subfolders. Is it possible to add a parameter to the CloudFront URL like: example.cloudfront.net/manual to get all content from the manual folder? I tried this with behaviours (manual/subfolder/*) but it didnt work.

The next thing would be to make it accessible with a custom domain. If I have subdomain.example.com I would like to access example.cloudfront.net/manual/subfolder with subdomain.example.com/manual/subfolder.

BR Mark

1 Answer
0

Hello.

When CloudFront requests a resource from S3, it requests the URL path as is from S3, so it is not possible to retrieve it without specifying the file name in the URL.
So, for example, to display test.html in the folder "example.cloudfront.net/manual", you need to enter "example.cloudfront.net/manual/test.html".
I don't think you can display files with the setting "manual/subfolder/*".

You can set up a custom domain on CloudFront by following the steps in the document below.
https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/CNAMEs.html

profile picture
EXPERT
answered 5 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions