I want to create a new subdomain cdn.domain.com and serve all media/js/css trough that subdomain, to speed up total page load. But therefore I want to create a new cdn folder, outside my current root folder.

Is that possible and is it enough to change the system/configuration/general/web/unsecure and system/configuration/general/web/secure to cdn.domain.com?

I mean are all new images than saved to the right folder directly or do I need to change other things as well?


No, you'll have to change other things as well. Magento does not have a CDN application built-in, so the CDN would have to be set up with another application. You could use Apache Vhosts for this to do it on the same server.

Changing those system configuration paths will have drastic consequences to your store. Cookies will break, your admin panel will have issues, etc. However, if you change the base skin url, base JS url, and base media url, to match your CDN, that should be fine.

Please let me know if you have any questions!

  • Thanks for your info. So your advise will be, to keep it the default way? So don't change the base js and media url? – JGeer Dec 21 '16 at 13:48
  • Well, you can change them when you have a CDN configured... – tjons Dec 21 '16 at 13:49
  • But, @HenkZ, it won't work well unless you configure a CDN. Glad it helped! Would you be willing to upvote and/or accept? – tjons Dec 21 '16 at 13:50
  • So when setting Apache Vhosts and then changing the base URL's should do the trick? – JGeer Dec 21 '16 at 13:54
  • why do you need another media folder?? you just create a subdomain and point it to your root folder as main domain. – MagenX Dec 21 '16 at 14:17

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.