Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

davy_yg's avatar
Level 27

Can't use font awesome

Hello,

I am trying to use font awesome icons.

This icon don't show up:

	<script src="https://kit.fontawesome.com/a076d05399.js" crossorigin="anonymous"></script>

	<i class="fas fa-times">

In Network Tabs: Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://kit.fontawesome.com/a076d05399.js. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 403

() GEThttps://kit.fontawesome.com/a076d05399.js

ref: https://stackoverflow.com/questions/41014399/hosted-website-font-awesome-cross-origin-request-blocked

I did try placing this in .htaccess

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

Any idea why?

0 likes
1 reply
petrit's avatar

You can include it from CDN

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css" />

Please or to participate in this conversation.