【发布时间】:2017-08-31 09:40:30
【问题描述】:
我这样称呼我的字体:
@font-face {
font-family: 'dinar';
src: url('../fonts/dinarm.eot?#'),
local('?'),
local('Mj_Dinar Two Medium'),
url('../fonts/dinarm.woff') format('woff'),
url('../fonts/dinarm.ttf') format('truetype'),
url('../fonts/dinarm.svg') format('svg');
font-weight: normal;
font-style: normal
}
@font-face {
font-family: 'font-bmi';
src: url('../fonts/font-bmi/font-bmi.eot');
src: url('../fonts/font-bmi/font-bmi.eot') format('eot'),
url('../fonts/font-bmi/font-bmi.woff') format('woff'),
url('../fonts/font-bmi/font-bmi.ttf') format('truetype');
font-weight: normal;
font-style: normal
}
每次使用 Internet Explorer 的用户尝试访问该站点时,我都会在网络主机使用日志中看到大量 404 错误,最后该用户被我的安全插件禁止。有一个使用日志的例子:
80.00.000.146 - - [05/Apr/2017:00:46:10 +0430]
"GET /wp-content/themes/fonts/font-bmi/font-bmi.eot)%20format(%22eot%22),
%20url(../fonts/font-bmi/font-bmi.woff)%20format(%22woff%22),
%20url(../fonts/font-bmi/font-bmi.ttf)%20format(%22truetype%22 HTTP/1.1" 404 4058
"http://www.21tech.ir/some-page/" "Mozilla/4.0
(compatible; MSIE 8.0; Windows NT 5.1; --some other information--)"
我知道它写了Mozilla/4.0,但它实际上是 IE 我已经测试过了。
有什么问题,如何解决或避免?
【问题讨论】:
-
路径应该相对于 css 文件本身,而不是来自调用 css 的页面。这是正确的道路吗?
-
@iguypouf 是的,它只发生在 IE 上。
标签: css internet-explorer http-status-code-404 font-face