Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize the normal display of svg/woff/woff2 fonts in IIS7 environment

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the relevant knowledge of "how to achieve normal display of svg/woff/woff2 fonts in IIS7 environment". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Recently, several of the company's WordPress websites have moved from AWS to Windows, which has been bothering us for a long time. A new problem came out today and found that the woff font on the website reported 404 again. After confirming that the file has been uploaded to the correct path, think back to the problem that the font file could not be found in the IIS environment. I feel that it should be the reason why the font file has not been added MIME type. Windows Azure is not a virtual host, so it won't give me an IIS to configure, so I can only think of other ways.

Fortunately, a web.config file was found in the root directory of the website, which should be the configuration file for ASP.NET 's application in my impression. Although WordPress uses the PHP language, the management of file types should not involve the scope of what language the website uses, as long as the server environment is configured correctly.

Open web.config, which is a XML file with the MIME type information of a svg file, which is similar to what was previously configured in IIS:

Previously, the MIME type settings for several font files in IIS are as follows:

Add these two items to web.config in the same way:

The tag structure for the MIME type in the entire file should look like this:

...

Refresh the web page after completion, woff and other fonts can be loaded smoothly again. For the setting method under IIS6, please refer to how to make IIS6 support svg image display.

This is the end of the content of "how to realize the normal display of svg/woff/woff2 fonts in IIS7 environment". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report