We are currently using AWS CDN to fetch images uploaded. In Magento admin, if I upload any image, it goes to CDN and then it show me the CDN path in <img src>.

Now, we have a third party content site from where we need to show images using CDN.

In Magento, if the image is normally uploaded from admin it shows path something like:

<img src="http://d56xhwfHe9rhq4.cloudfront.net/skin/frontend/package/theme/images/logo.gif" alt="" />

For ex: http://mysite.com/images/new-logo.gif resides on my third party content site.

And if the image is coming from third party content site, it currently shows like

<img src="http://thirdpart.com/media/images/new-logo.gif" alt="" />

which should be like below with CDN

<img src="http://d56xhwfHe9rhq4.cloudfront.net/media/images/new-logo.gif" alt="" />

How can I make CDN work with both normal magento image upload from admin as well as showing third party images with complete path ?

How can I achieve this ?



2 Answers 2


I think you could stay out of the Magento code completely - Cloud-front distributions can point to multiple origin servers:

Support for Multiple Origins - You can now reference multiple origins (sources of content) from a single Cloud-front distribution. This means that you could, for example, serve images from Amazon S3, dynamic content from EC2, and other content from third-party sites, all from a single domain name. Being able to serve your entire site from a single domain will simplify implementation, allow the use of more relative URLs within the application, and can even get you past some cross-site scripting limitations.

from: http://aws.amazon.com/blogs/aws/amazon-cloudfront-support-for-dynamic-content/


This can be done by an extension, which you'll find in the web at GitHub (for free) or Magento Connect (might cost something).

First solution: You need to rewrite some of the Core-Classes or -Methods, which is always dangerous (with each update of Magento and compatibility with other extensions).

Second Solution: You change the whole design, so that it uses a new class or method to deliver images or compose the path you need.

Both cases need additional options in the admin panel.

You also might want to use the search keywords "magento external images" in your favorite search engine, which gives you additional options and a hint like this:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.