AWS CloudFront is a popular solution for deploying websites and single page applications (SPAs). There are a number of useful resources online explaining how to accomplish this. When developing SPAs, it’s often useful to be able to quickly deploy different branches or versions of the code, but in the case of hosting with CloudFront, this typically means overwriting another version or setting up additional infrastructure. This post explains how to deploy multiple sites on different subdomains using a single S3 bucket and CloudFront distribution. The reasoning behind this is to be able to push different SPAs or SPA versions to the same S3 bucket, giving each their own domain, without having to provision any additional infrastructure. This is not a step-by-step tutorial, but it does contain relevant sample code.