如何让 IIS 在我的网站上正确提供 .webmanifest 文件? [英] How Can I have IIS properly serve .webmanifest files on my web site?

查看:35
本文介绍了如何让 IIS 在我的网站上正确提供 .webmanifest 文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  1. 在那里,点击右侧菜单中的添加...".

  2. 在打开的对话框中,在 MIME 类型框中的文件扩展名框 application/manifest+json 中指定 .webmanifest.

  1. 点击确定".

恭喜;您刚刚在 IIS 上为 .webmanifest 定义了 MIME 类型.

The Favicon Generator assembles a package for webmasters to use in order to have icons available for many different devices. The page comes with a file called site.manifest which is linked to via the following tag in the web page's document <head>:

<link rel="manifest" href="site.webmanifest">

According to Mozilla: "The web app manifest provides information about an application (such as name, author, icon, and description) in a JSON text file. The purpose of the manifest is to install web applications to the homescreen of a device, providing users with quicker access and a richer experience."

Unfortunately if you are using Microsoft's Internet Information Services (IIS), you'll get a 404.3 error if you try and access the site.webmanifest file.

The exact error message is as follows: "The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map."

How can I properly serve site.webmanifest files in IIS?

解决方案

By default, IIS does not serve any files that does not have a MIME map associated with it in its (IIS) core settings.

To address this challenge, you will need to map the .webmanifest file extension to its appropriate MIME type.

To accomplish this, open IIS and follow the steps below;

  1. On the left hand side, select either your web site or the entire server in the "Connections" menu. If you select the server, your MIME mapping will apply to every web site on the server. If you select a web site, it will only apply to a single web site.

  2. Next, select "MIME Types" from the IIS menu:

  1. Once there, click "add..." from the right hand menu.

  2. In the dialog box that opens specify .webmanifest in the file name extension box application/manifest+json in the MIME type box.

  1. Click "OK".

Congratulations; you've just defined the MIME type for .webmanifest on IIS.

这篇关于如何让 IIS 在我的网站上正确提供 .webmanifest 文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆