当前位置:网站首页>IIS cannot load * woff,*. woff2,*. Solution of SVG file

IIS cannot load * woff,*. woff2,*. Solution of SVG file

2022-04-23 21:21:00 The man running the horse doesn't get enough sleep

After website publishing , request *.woff,.woff2,.svg All you get from such files is 404, How can we solve this situation ?

Solution 1 :

To server IIS add to SVG,WOFF,WOFF2 Extensions of these file types , That is to say IIS Add MIME type .

  1. Turn on the server IIS Manager –》 Choose the website to publish –》 In the function view , choice MIME type
     Insert picture description here

  2. choice MIME type –》 Mouse click –》 Get into MIME Type management list –》 Click on the top right corner “ add to …”
     Insert picture description here

  3. Enter the corresponding file extension and MIME type , Click on “ determine ” That's it
        1) .woff application/x-font-woff
        2) .woff2 application/x-font-woff
        3) .svg image/svg+xml
     Insert picture description here

Solution 2 :

Open the configuration file of the website program , stay system.webServer Add the following configuration to the node :

<staticContent>
      <remove fileExtension=".woff"/>
      <mimeMap fileExtension=".woff" mimeType="application/x-font-woff" />
      <remove fileExtension=".woff2"/>
      <mimeMap fileExtension=".woff2" mimeType="application/x-font-woff2" />
      <remove fileExtension=".svg" />
      <mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
</staticContent>

 Insert picture description here

版权声明
本文为[The man running the horse doesn't get enough sleep]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/111/202204210543443103.html