We use AWS S3 for hosting our React website. On top of it there is a Cloudfront distribution, which points our custom domain name https://www.mycompany.com to the mentioned website.

Now, our marketing team wants a Wordpress site hosted at https://www.mycompany.com/blog

We have managed to install Wordpress in a EC2 instance with a LB hosted at https://blog.mycompany.com

How can we forward https://www.mycompany.com/blog to https://blog.mycompany.com (or LB or EC2 instance) using Cloudfront?

We have tried adding blog.mycompany.com as an Origin in "Origins and Origin Groups" tab. And then adding a new "Behavior" for blog* path pattern and point it to your newly created "blog.mycompany.com" origin. But that does not seem to work well, given when accessing https://www.mycompany.com/blog we still see our React website.

  • Hey, can you add configuration for your cloudfront behaviour in the question as well. Would be helpful. Also, can you check the certificate attached on the distribution? Is it *.mycompany.com or just mycompany.com? – Piyush Baderia Apr 19 at 20:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.