0

i get this errors not on my website but when i test it on web.dev in section "Best Practices" ... how can i fix that ?

Some here says this code will fix it :

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

I put the code above in my .htaccess but google still gives that error

1 Answers1

0

Based on shaitana & Stephen Ostermiller's answer you could add this rule to your .htaccess

Header add Access-Control-Allow-Origin "*"

Or better if you specified the domain value

Header add Access-Control-Allow-Origin "your-domain.example"
rudi
  • 35
  • 3