I'm trying to change the base urls for static and media files to the URL of my CDN however when I change them, I get 404 not found for all images/media/static/css/js

All files and content is available on the CDN url as I can go to a file directly by going to e.g.


Yet the URL of the file (and all others) that is trying to load on the site is like this:


Its missing the /pub/static/ bit out

I am currently in developer mode and have tried doing the change in di.xml as per Magento 2 : Symbolic links to pub/static files

I have a .htaccess file in /pub/static but maybe it is incorrect in there?

Does anyone have any ideas please?

  • I can add in my base urls for static and media like so and it seems to work alot better i.e. CDNURL/pub/static & CDNURL/pub/media - however product images and theme icons do not seem to work - are these the correct format for the urls or should it work with just CDNURL ? – Richard Laws Aug 21 '17 at 14:55

Your Answer

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

Browse other questions tagged or ask your own question.