wordpress - 字体的 Cors 问题
问题描述
目前在 wordpress 网站上有一些 cors 政策问题。
我尝试编辑 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.
解决方案
推荐阅读
- c# - 如何在 WPF 运行时动态获取数据网格中的嵌套行?
- android - 指定的命名范围不存在
- python - 如果前一个服务器抛出错误,如何让 Python 尝试备用服务器
- python - 如何在列之间进行求和和除以更改数据框中现有列的值?
- html - 无法使用 xpath 查询提取值
- makefile - 将 Fortran 模块链接在一起
- javascript - Tempus Dominus 使用 datetimepicker 防止输入字段上的移动键盘
- javascript - 如何在按下热键时修复动态输入创建的重复
- r - 如果该对象尚不存在,我可以告诉 R 创建一个对象吗?
- regex - 如何在Oracle中找到字符串的完全匹配并替换?