将 MIME 类型永久添加到 IIS
Permanently adding a mime type to IIS
目前如果通过iis添加MIME类型如下:
Open Internet Information Services (IIS) Manager
In the Connections pane, go to the site, application, or directory for
which you want to add a MIME type. In the Home pane, double-click MIME
Types.
In the MIME Types pane, click Add... in the Actions pane.
In the Add MIME Type dialog box, add the file name extension and MIME
type, and then click OK.
IIS 将在您执行 IISRESET 时删除该条目。有一些开发人员正在执行 IISRESET 并清除用户创建的 mime 类型。我的问题是,我如何才能永久添加 MIME 类型,以便即使开发人员执行 IISRESET,它也不会被清除并保留为其他默认 MIME 类型。谢谢
重置 IIS 不应重置值。我会检查您是否有执行类似操作的应用程序启动。话虽如此,您可以将值添加到服务器配置文件中:
C:\Windows\System32\inetsrv\config\applicationHost.config
您可以这样添加标准映射:
<staticContent>
<mimeMap fileExtension=".ext" mimeType="text/plain" />
</staticContent>
这些值不会在服务重新启动期间重置。
目前如果通过iis添加MIME类型如下:
Open Internet Information Services (IIS) Manager
In the Connections pane, go to the site, application, or directory for which you want to add a MIME type. In the Home pane, double-click MIME Types.
In the MIME Types pane, click Add... in the Actions pane.
In the Add MIME Type dialog box, add the file name extension and MIME type, and then click OK.
IIS 将在您执行 IISRESET 时删除该条目。有一些开发人员正在执行 IISRESET 并清除用户创建的 mime 类型。我的问题是,我如何才能永久添加 MIME 类型,以便即使开发人员执行 IISRESET,它也不会被清除并保留为其他默认 MIME 类型。谢谢
重置 IIS 不应重置值。我会检查您是否有执行类似操作的应用程序启动。话虽如此,您可以将值添加到服务器配置文件中:
C:\Windows\System32\inetsrv\config\applicationHost.config
您可以这样添加标准映射:
<staticContent>
<mimeMap fileExtension=".ext" mimeType="text/plain" />
</staticContent>
这些值不会在服务重新启动期间重置。