Web Server font. svg/. woff/. woff2 404 error solution,. woff. woff2

Source: Internet
Author: User

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!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.