php - Google Font Blocked by Origin Access Policy -


i have errors when try load google font. errors show in console.

access font @ 'http://fonts.gstatic.com/s/opensans/v13/dxi1orhcpsqm3vp6mxoategdm0lzdjqr5-oayxsoefg.woff2' origin 'http://example.com' has been blocked cors policy: no 'access-control-allow-origin' header present on requested resource. origin 'http://example.com' therefore not allowed access.

i have been try various ways still cannot solve errors.

this have been try.

first, add in .htaccess

<ifmodule mod_headers.c>   <filesmatch "\.(ttf|ttc|otf|eot|woff|woff2|font.css|css|js)$">     header set access-control-allow-origin "*"   </filesmatch> </ifmodule> 

second, put on top of php file

<?php header('access-control-allow-origin: *'); ?> 

third, add .htaccess

<filesmatch "\.(ttf|otf|eot|woff)$">       <ifmodule mod_headers.c>         header set access-control-allow-origin "*"       </ifmodule>     </filesmatch> 

from ways got nothing solve errors. can me solve ?

thank you.


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -