Web Server font. svg/. woff/. woff2 404 error solution,. woff. woff2
Let's take a look at the problem.
It is reasonable to say that 404 should not be reported, because the file under my path does exist.
I believe that many developers have encountered the font reference problem, but the path is clearly correct, but the browser outputs an error message. The cause is that the Web server does not recognize file types such as. svg/. woff/. woff2.
Solution:
If it is deployed on the iis server, open IIS Manager> MIME> directly Add the following extension and MIME Type
File Extension |
MIME Type |
. Svg |
Image/svg + xml |
. Woff |
Application/x-font-woff |
. Woff2 |
Application/x-font-woff |
For local IIS Express, there are two methods:
Method 1: Use the CMD command to add the MIME type
1) Open CMD and enter cd C: \ Program Files (x86) \ IIS Express
2) input: appcmd set config/section: staticContent/+ [fileExtension = 'file extension', mimeType = 'mime type'] and press Enter. Success! Prompt
Method 2: Manually add the MIME type
1) Find the IIS Express icon at the bottom right of the Computer> right-click to "show all applications"
2) Click the website name, and the configuration path will appear. Click this path to open the IIS Express configuration file.
3) Search for the mimeMap node and find the keyword mimeMap. Add the required extension and MIME Type and save the settings!