Reputation: 239
I have an index.html file that is hosted on a paid cdn server, and I want my website that is on a cheap webhost to load the index.html from the cdn server and use the cdn's resource instead.
I've tried:
<?php echo file_get_contents('http://cdn-hosted.com/index.html');?>
Everything loads fine, but it seems to be using my web host resource instead. Any suggestions instead of using iframe?
the cdn server doesn't render php codes.
Upvotes: 0
Views: 274
Reputation: 2539
That this is served from your own server is totally expected. Your DNS records determine where a resource is loaded from.
If you really want to server you whole site from CDN, then make cdn-hosted.com an CNAME record of your website domain name, ie. www.yourwebsite.com or maybe just yourwebsite.com
Upvotes: 3