Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fontawesome Cross origin issues

I want to load Fontawesome from a CDN but I get

failed cross-origin request. Resource access is restricted

I know that to fix this a HTTP header should be added, but is there any way to avoid doing this?

I tried replacing '../font/fontawesome-webfont.eot?v=3.2.0') with full urls but it didnt help for some reason. Is there anything that can be done without the header?

like image 929
Jim Avatar asked Jun 07 '26 16:06

Jim


1 Answers

You have to create .htaccess file on font folder with this text.

<FilesMatch ".(eot|ttf|svg|otf|woff|woff2)">
  Header set Access-Control-Allow-Origin "*"
</FilesMatch>
like image 98
Leonel Lands Avatar answered Jun 10 '26 09:06

Leonel Lands



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!