CNAME Wildcard Support for Amazon CloudFront
Amazon CloudFront makes it easy for you to get your dynamic and static content out to a global audience. You simply host your static content in Amazon S3 or your dynamic content on Amazon EC2, create a CloudFront distribution, and use the domain name for the distribution in the URL path for your content.
You can also use CloudFront with your existing domain names by associating one or more CNAMEs with the distribution. If you own example.com and serve images and video from images.example.com and video.example.com respectively, you can route requests for either subdomain to the same distribution by explicitly adding each subdomain to your distribution’s configuration.
Today we are extending CloudFront’s existing CNAME support to include wildcard domain names. Instead of having to list the subdomains individually, you can now use a domain name with the form *.example.com to route requests made to all of the subdomains to the same distribution:
You can then use CloudFront’s Custom Behaviors feature to further customize the handling of each request:
This feature is available now and you can start using it today. Read all about Using Alternate Domain Names (CNAMES) to learn more.