0

Probably a simple question but I have installed magento 2.4 and I am getting console errors like the one below:

Access to font at 'http://localhost/magento2/pub/static/version1610053755/frontend/Magento/luma/en_GB/fonts/opensans/light/opensans-300.woff2' from origin 'http://localhost:8888' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

This looks to me because it is requesting the static resources from http://localhost instead of http://localhost:8888.

Does anyone know how to change this behavior.

1 Answer 1

0

Added this line of of code in .htaccess underneath RewriteEngine on

RewriteCond %{SERVER_PORT} 8888

If anyone has a better solution please post a solution as this solution means I have to remember to remove this when it gets migrated to the live environment.

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.