css - /icons/icomoon.woff 文件 404 在 Cloudways 中找不到
问题描述
我在生产中看不到 icomoon 图标,因为它返回 404 错误:
GET /icons/icomoon.woff net::ERR_ABORTED 404(未找到)
GET /icons/icomoon.woff2 net::ERR_ABORTED 404(未找到)
文件在正确的路径中:公共/图标
我在 public/icons/style.css 中有以下代码:
font-face {
font-family: 'icomoon';
src:
url('icomoon.woff') format('woff'),
url('icomoon.woff2') format('woff2');
font-weight: normal;
font-style: normal;
font-display: block;
}
我试图以这种方式放置 src:
src: url('icomoon.woff') format('woff');
src: url('icomoon.woff2') format('woff2');
但它没有用。
我还尝试将以下代码放在 public/web.config 中:
<system.webServer>
<staticContent>
<clientCache cacheControlCustom="public" cacheControlMode="UseMaxAge" cacheControlMaxAge="365.00:00:00" />
<remove fileExtension=".woff" />
<remove fileExtension=".woff2" />
<mimeMap fileExtension=".woff" mimeType="application/x-font-woff" />
<mimeMap fileExtension=".woff2" mimeType="application/font-woff2" />
</staticContent>
而且它也不起作用。
解决方案
已解决,Cloudways 默认禁用 .woff 文件的执行。我所要做的就是打开一张票并要求他们启用它。
推荐阅读
- excel - 如何将自定义 ID 作为 Firebase 默认 ID
- python - 如何在 Python 的 VS Code 调试模式下后退一步?
- python-3.x - python - 使用 read_csv() 将 numpy 数组导入为 str
- vb.net - 如何将 wmf 文件动态分配给图片框
- python - 如何通过比较 Pandas 中另一列的值来填充列中的值
- python - 如何有效地删除欧几里德图中一对边之间的交集?
- ios - 在 RN 上开发时如何为 iOS 设置默认文本颜色
- javascript - Puppeteer:将返回结果与文本文件进行比较
- spring - Spring 无法识别 application.proerties 文件。无法显示属性文件中的配置定义
- r - 将数据操作转换为 R 中的函数