I am thinking of using CloudFront distribution as CDN to server my images, css and js. I have a CloudFront distribution setup to point to the same directory in the server where my code is, just changing the subdomain to cdn so it'd be cdn.domain.com
.
My problem is, this CDN subdomain would sever the HTML and php links too which I don't want it to do. I just want to use Cloudfront images, css and js.
Can you please point me to proper ways to do this? Is there a way to do this within the cloudfront panel?
I think we can server 404 page from htaccess once the the call gets to origin server but I am looking for a better option that would actually prevent the request from reaching the origin server.