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.

asked Jan 7, 2021 at 21:51

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.

answered Jan 7, 2021 at 22:39

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.