CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource

Here are some issue we encountered when we are using custom font “woff or ttf”.

error-font

Simply go to your .htaccess and add this line.

<IfModule mod_headers.c>
  <FilesMatch "\.(ttf|ttc|otf|eot|woff|font.css|css)$">
    Header set Access-Control-Allow-Origin "*"
  </FilesMatch>
</IfModule>

And make sure when you are saving your .htaccess it has the permission and tried to open and reopen it again just to make sure the the codeĀ is added.

Leave a Reply

Your email address will not be published. Required fields are marked *