1

I'm using AWS CloudFront with Magento 2.4. When dev/static/sign is disabled, I have absolutely no issues with the CDN. When dev/static/sign is enabled though, all static resources are redirected to the origin url.

I've tried this and this, with no success.

Has anyone encountered this?

3
  • 1
    I have the exactly same error, but didn't checked with unsigned to "no". Could it be related to the rewrite url of the version in the path?
    – Mr.K
    Oct 1, 2020 at 21:25
  • 1
    @Mr.K I've got a feeling that it has to do with rewrites, but I'm not totally sure. I'll keep trying!
    – Hunter
    Oct 2, 2020 at 14:01
  • 1
    @Mr.K see the answer below!
    – Hunter
    Oct 2, 2020 at 14:57

1 Answer 1

1

I've found the solution to this issue.

My web root is MagentoDir/pub. In pub/static/.htaccess, the RewriteBase was set to /pub/static. When I changed that value to /static/, restarted apache and flushed Magento's caches, the problem was solved.

1
  • Than you! I need to check the similar fix for nginx config
    – Mr.K
    Oct 3, 2020 at 18:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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