I have created two websites using one magento installation, like:

  1. abc.com (original)
  2. xyz.com (second domain)

Both are working fine except the fonts issue I got on sub domain (second website). Error is:

Font from origin 'abc.com' has been blocked from loading by Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'xyz.com' is therefore not allowed access.

I have add the following code to .htaccess of main site but not working.

.htaccess code:

<FilesMatch "\.(ttf|otf|eot|woff)$">
    <IfModule mod_headers.c>
        Header set Access-Control-Allow-Origin "xyz.com"
<IfModule mod_headers.c>
    <FilesMatch "\.(svg|ttf|otf|eot|woff|woff2)$">
        Header set Access-Control-Allow-Origin "*"
  • try with Header set Access-Control-Allow-Origin "*" – Minesh Patel May 13 '16 at 10:08
  • 1
    @MineshPatel i already tried that one if you look on my code.thanks – Mahmood Rehman May 13 '16 at 10:12
  • @MahmoodRehman, Have you found any solution for this? – Pushpendra Singh May 3 '18 at 12:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.