@font-face EOT 未通过 HTTPS 加载 [英] @font-face EOT not loading over HTTPS

查看:30
本文介绍了@font-face EOT 未通过 HTTPS 加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 IE 7,8,9 中通过 HTTPS 使用 @font-face 时遇到问题 - 它根本没有加载.包含的 HTML 页面是否托管在 HTTPS 上并不重要,当我尝试通过 HTTP 加载 EOT 字体时,它可以工作,而 HTTPS 则不行.有没有人见过这种行为?

I'm running into an issue using @font-face over HTTPS in IE 7,8,9 - it simply is not loading. It does not matter whether the containing HTML page is hosted on HTTPS or not, when I try to load the EOT font over HTTP it works, HTTPS it doesn't. Has anyone seen this behavior?

托管字体的服务器正在发送正确的 content-type="application/vnd.ms-fontobject"

The server hosting the font is sending the proper content-type="application/vnd.ms-fontobject"

我尝试了多种字体,所以它不是特定于字体的.

I've tried multiple fonts, so it's not specific to the font.

字体是在 Font Squirrel

@font-face {
font-family: 'GothamCondensedBold';
src:url('path/to/fontgothmbcd-webfont.eot');
src:url('path/to/fontgothmbcd-webfont.eot?#iefix') format('embedded-opentype'),
    url('path/to/fontgothmbcd-webfont.woff') format('woff'),
    url('path/to/fontgothmbcd-webfont.ttf') format('truetype'),
    url('path/to/fontgothmbcd-webfont.svg#GothamCondensedBold') format('svg');
font-weight: normal;
font-style: normal;
}

示例页面

http://gregnettles.net/dev/font-face-test.html>

推荐答案

我知道这是一个旧线程,但我只是不得不权衡一下.我们在所有版本的 Internet Explorer (7-11) 不通过 HTTPS 加载.经过数小时的反复试验并将我们的标头与其他工作站点进行比较,我们发现是 vary 标头将事情搞砸了.取消设置这些文件类型的标头立即解决了我们的问题.

I know this is an old thread but I just had to weigh in. We had the same issue with EOT and WOFF fonts in all versions of Internet Explorer (7-11) not loading over HTTPS. After hours of trial and error and comparing our headers with other working sites we found it was the vary header that was messing things up. Unsetting that header for those file types fixed our issue right away.

<FilesMatch ".(woff)$">
    Header unset Vary
</FilesMatch>

<FilesMatch ".(eot)$">
    Header unset Vary
</FilesMatch>

奖励阅读

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆