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

0

I have a website served by cloudfront at https://mysite.com using S3 origin.

I have a webflow blog project using a custom domain pointing to http://blog.mysite.com via CNAME in route53.

How can I serve the webflow blog project directly under https://mysite.com/blog ?

Using the subdomain https://blog.mysite.com 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개 답변
0

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.

전문가
답변함 2년 전
  • Hey @skinsman, thank you for the suggestion! I tried implementing this however when I visit https://mysite.com/blog, it redirects to https://blog.mysite.com/blog. What I want to do is have the blog actually render under mysite.com/blog 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 blog.mysite.com

  • Borg, you did well and it should rewrite, not redirect. So the user should still see https://mysite.com/blog.

    This is a standard CloudFront feature.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠