How can I serve a blog under a subdirectory of my site using cloudfront/lambda@edge?


I have a website served by cloudfront at using S3 origin.

I have a webflow blog project using a custom domain pointing to via CNAME in route53.

How can I serve the webflow blog project directly under ?

Using the subdomain is not preferable for SEO reasons (but the subdomain is live and operational pointing to the webflow project)

Can I achieve this using lambda@edge?

1 Answer

You should be able to do this in CloudFront using multiple CacheBehaviors and Origins. The default CacheBehavior stays as now, pointing to your S3 Origin. Add a 2nd CacheBehavior with a PathPattern "blog/*" pointing to the Custom Origin URL for your webflow blog.

answered 10 months ago
  • Hey @skinsman, thank you for the suggestion! I tried implementing this however when I visit, it redirects to What I want to do is have the blog actually render under but maybe that's not possible unless I'm self hosting the assets?

    To get the above working I created a CacheBehavior with PathPattern: blog/* and custom origin with domain

  • Borg, you did well and it should rewrite, not redirect. So the user should still see

    This is a standard CloudFront feature.

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