Answer the question
In order to leave comments, you need to log in
How to solve the problem with loading fonts?
Good day, dear ones!
There was such a problem - the fonts on the site are not loaded. At the same time, everything works fine on the local host.
I checked it once - all the paths are spelled out correctly, the Firefox console shows 200 OK, but the fonts do not work, even cry!
For testing, I connected the font with Googlefont - it works.
In the end, I think I found the problem! In the .htaccess file, requests are sent to index.php (for CNC)
DirectoryIndex index.php
AddDefaultCharset windows-1251
AddCharset windows-1251 .php
RewriteEngine On
RewriteCond %{HTTP_HOST} ^([^www].*)$
RewriteRule ^(.*)$ http://www.%1/$1 [L,R=301]
RewriteRule .* index.php [L]
Answer the question
In order to leave comments, you need to log in
not at all because of this, you
show how to connect the font in css or by some other method what kind
of font
krumza , strange. It's just that when you remove this line RewriteRule .* index.php [L] in .htaccess, the fonts work (but the CNC collapses and the site itself does not plow, of course).
Connection is standard:
@font-face {
font-family: "RobotoRegular";
src: url("../fonts/RobotoRegular/RobotoRegular.eot");
src: url("../fonts/RobotoRegular/RobotoRegular.eot?#iefix") format("embedded-opentype"),
url("../fonts/RobotoRegular/RobotoRegular.woff") format("woff"),
url("../fonts/RobotoRegular/RobotoRegular.ttf") format("truetype");
font-style: normal;
font-weight: normal;
}
@font-face {
font-family: 'Decor6Di';
src: url('../fonts/Decor6Di/Decor6Di.eot');
src: url('../fonts/Decor6Di/Decor6Di.eot') format('embedded-opentype'),
url('../fonts/Decor6Di/Decor6Di.woff2') format('woff2'),
url('../fonts/Decor6Di/Decor6Di.woff') format('woff'),
url('../fonts/Decor6Di/Decor6Di.ttf') format('truetype');
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question