Answer the question
In order to leave comments, you need to log in
How to specify Access-Control-Allow-Origin on a subdomain?
Hello! Guys, such a question - did anyone use their fonts on a subdomain? Otherwise it gives an error in the console:
Font from origin 'site.ru' has been blocked from loading by Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'sub.site.ru' is therefore not allowed access.
I wrote a rule in htaccess:
<FilesMatch "\.(ttf|ttc|otf|eot|woff)$">
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>
</FilesMatch>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question