Css 未以并行加载样式加载字体

Css 未以并行加载样式加载字体,css,fonts,parallel-processing,Css,Fonts,Parallel Processing,我目前正在使用同一个代码库在多个站点上设置并行加载,我遇到了字体未加载到样式中的问题 以下是它的设置方式: .htaccess: # Images / Styles / Scripts rewrites RewriteCond %{HTTP_HOST} ^(images\.)?([^.]+) [OR] RewriteCond %{HTTP_HOST} ^(styles\.)?([^.]+) [OR] RewriteCond %{HTTP_HOST} ^(scripts\.)?([^.]+) Re

我目前正在使用同一个代码库在多个站点上设置并行加载,我遇到了字体未加载到样式中的问题

以下是它的设置方式:

.htaccess:

# Images / Styles / Scripts rewrites
RewriteCond %{HTTP_HOST} ^(images\.)?([^.]+) [OR]
RewriteCond %{HTTP_HOST} ^(styles\.)?([^.]+) [OR]
RewriteCond %{HTTP_HOST} ^(scripts\.)?([^.]+)
RewriteRule .* - [E=DOMAIN_SEGMENT:%2]
在头上

<link type="text/css" rel="stylesheet" href="http://styles.test.com/font-awesome/css/font-awesome.min.css">
许多网站使用相同的代码库,不可能在CSS中硬设置字体的域。 在并行更改之前,所有字体都加载良好

样式表的其余部分正在正确加载


谢谢

我发现问题,字体试图从
style.test.com/fonts/aller\u rg-webfont.eot
加载,因此无法加载

一个解决方案是在我的.htaccess文件中使用它

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

标题集访问控制允许原点“*”
应用此

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