Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache 在http标头中为.ttf文件指定一个字符集_Apache_.htaccess_Http_Truetype - Fatal编程技术网

Apache 在http标头中为.ttf文件指定一个字符集

Apache 在http标头中为.ttf文件指定一个字符集,apache,.htaccess,http,truetype,Apache,.htaccess,Http,Truetype,我在GTmetrix上测试了我的网站性能,它要求我在.htaccess中为.tff文件指定一个字符集,但我不知道如何修复它。你有答案吗 谢谢你的帮助!;) 这应该可以-对我来说很有用: <FilesMatch "\.(ttf)$"> ForceType 'font/opentype; charset=UTF-8' </FilesMatch> ForceType字体/opentype;字符集=UTF-8' 谢谢您的回答!我找到了另一种解决方法:我添加了这一行Add

我在GTmetrix上测试了我的网站性能,它要求我在.htaccess中为.tff文件指定一个字符集,但我不知道如何修复它。你有答案吗


谢谢你的帮助!;)

这应该可以-对我来说很有用:

<FilesMatch "\.(ttf)$">
   ForceType 'font/opentype; charset=UTF-8'
</FilesMatch>

ForceType字体/opentype;字符集=UTF-8'

谢谢您的回答!我找到了另一种解决方法:我添加了这一行
AddType应用程序/x-font-ttf.ttf
,并添加了一行来指定过期标题:
ExpiresByType应用程序/x-font-ttf“访问加2592000秒”
;)