【问题标题】:Sitecore 8.1 MIMEType font .woff issueSitecore 8.1 MIMEType 字体 .woff 问题
【发布时间】:2017-01-01 02:52:33
【问题描述】:

我们在应用程序中使用了新字体,所以我在 MimeTypes.config 文件中添加了以下内容

<mediaType extensions=".woff"><mimeType>application/font-woff</mimeType></mediaType>
<mediaType extensions=".woff2"><mimeType>application/font-woff2</mimeType></mediaType>

但它不起作用然后我删除了上面的内容并在 web.config 中添加了以下内容,它可以正常工作。

<staticContent>
   <remove fileExtension=".woff" />
   <!-- In case IIS already has this mime type -->
   <mimeMap fileExtension=".woff" mimeType="application/font-woff" />
   <remove fileExtension=".woff2" />
   <!-- In case IIS already has this mime type -->
   <mimeMap fileExtension=".woff2" mimeType="application/font-woff2" />
</staticContent>

但不明白为什么只在特定于 MIMEType 配置的 MimeTypes.config 中添加它时不起作用。

谢谢

【问题讨论】:

    标签: sitecore mime-types sitecore8.1 woff woff2


    【解决方案1】:

    在 mimetypes.config 中,您定义了 Sitecore 的扩展,但您还需要告诉 IIS 要做什么。这就是你在staticContent 部分所做的。

    【讨论】:

      猜你喜欢
      • 2013-02-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-04-05
      • 2021-07-26
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多