Question

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?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top