我是从原产地“http://static.example.com”具有以下错误字体已经加载的跨来源资源共享政策阻止:无“访问控制 - 允许 - Origin'标题出现在请求的资源上。因此不允许访问原产地'http://www.example.com'。字体已被封锁的跨来源资源共享政策
我使用下文
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault "access plus 1 month"
ExpiresByType text/cache-manifest "access plus 0 seconds"
........
<IfModule mod_headers.c>
Header append Cache-Control "public"
<FilesMatch "\.(ttf|otf|eot|woff|svg)$">
SetEnvIf Origin "^http://(.*)?example.com$" origin_is=$0
Header set Access-Control-Allow-Origin %{origin_is}e env=origin_is
</FilesMatch>
<FilesMatch "\.(js|css|xml|gz)$">
Header append Vary: Accept-Encoding
</FilesMatch>
</IfModule>
</IfModule>
请我需要这个
我试过,但它不工作,谢谢。 –
试试我已经添加到答案的替代选项。 – Lag