0

我们在应用程序中使用新字体,所以我在 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 中添加时它不起作用。

谢谢

4

1 回答 1

0

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

于 2016-10-09T08:20:17.123 回答