We use Amazon Cloudfront to host all our product images. We set up cloudfront so that cdn.mydomain.com
will get the images from www.mydomain.com
.
Recently, we have discovered that cdn.mydomain.com
has been indexed with Google because when we type cdn.mydomain.com
, Cloudfront serves full HTML version of our www version.
Is there anyway so that we allow Cloudfront to serve images only (jpg, gif, and png)?
Any suggestion would be welcome.
CloudFront provides a easy way to do this, in your distribution configuration go to the cache behaviors create a behavior that does only cache *.jpg
or if it is in images folder you can set rule to cache requests to that folder alone, its easy as that!
but definitely don't use rewrite rules! then there's no point in using cdn!!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With