字体的Cors问题

时间:2019-05-31 06:31:58

标签: wordpress .htaccess fonts cors

当前在wordpress网站上存在一些核心政策问题。

我尝试编辑htaccess。复制粘贴的种类如下 但是事实证明这是行不通的。我是wordpress的新手,只在这里进行维护。

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

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

IfModule mod_setenvif.c>
  <IfModule mod_headers.c>
    # mod_headers, y u no match by Content-Type?!
    <FilesMatch "\.(gif|png|jpe?g|svg|svgz|ico|webp)$">
      SetEnvIf Origin ":" IS_CORS
      Header set Access-Control-Allow-Origin "*" env=IS_CORS
    </FilesMatch>
  </IfModule>
</IfModule>

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

Header add Access-Control-Allow-Origin "*"



Access to font at 'https://interiorsfurniture.com/assets/themes/bridge-child/fonts/fontawesome-webfont.woff2?v=4.7.0' from origin 'https://www.interiorsfurniture.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

0 个答案:

没有答案