直播服务器错误WOFF字体MIME类型字体、错误、类型、服务器

2023-09-03 16:15:34 作者:棉花糖味的小仙女

我有一个asp.net MVC 4的网站,我使用WOFF字体。在VS的IIS运行时,一切正常。然而,当我上载的颈部,以托管的1and1(活服务器),我得到了以下内容:

I have an asp.net MVC 4 website where I'm using woff font. Everything works fine when running on VS IIS. However when I uploaded the pate to 1and1 hosting (live server) I get the following:

NetworkError:404未找​​到 -   http://www.com/Content/font/fontawesome-webfont.woff?v=3.2.1

NetworkError: 404 Not Found - http://www.com/Content/font/fontawesome-webfont.woff?v=3.2.1

当我有这个在我的web.config文件(如一些建议),我的Web应用程序停止工作完全和负载下去。

When I include this in my web.config (as some suggest) my web application stops working completely and load indefinitely.

    <staticContent>
        <mimeMap fileExtension=".woff" mimeType="application/font-woff" />
    </staticContent>

我是什么做错了吗?

what am I doing wrong?

推荐答案

您是否尝试过将在你的web.config一个新的之前删除的映射?

Have you tried removing the mapping before adding a new one in your web.config?

例如:

<configuration>
   <system.webServer>
        ...
        <staticContent>
           <remove fileExtension=".woff" />
           <mimeMap fileExtension=".woff" mimeType="application/font-woff" />
        </staticContent>