woff font MIME type on live server error

2019-04-05 07:13发布

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 Not Found - http://www.com/Content/font/fontawesome-webfont.woff?v=3.2.1

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?

1条回答
Root(大扎)
2楼-- · 2019-04-05 07:59

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

For Example:

<configuration>
   <system.webServer>
        ...
        <staticContent>
           <remove fileExtension=".woff" />
           <mimeMap fileExtension=".woff" mimeType="application/font-woff" />
        </staticContent>
查看更多
登录 后发表回答