如何向.htaccess添加MIME类型?

时间:2022-10-31 22:15:10

I would like to add the following MIME type to a site run by Apache:

我想将以下MIME类型添加到Apache运行的站点:

<mime-mapping>
  <extension>jnlp</extension>
  <mime-type>application/x-java-jnlp-file</mime-type>
</mime-mapping>

That is the Tomcat format.

这是Tomcat格式。

I'm on a shared host, so I can only create an .htaccess file. Would someone please specify the complete contents of such a file?

我在共享主机上,所以我只能创建一个.htaccess文件。有人请指定这样一个文件的完整内容吗?

2 个解决方案

#1


9  

AddType application/x-java-jnlp-file .jnlp

Note that you might not actually be allowed to do that.

请注意,您可能实际上不允许这样做。

See also the documentation of the AddType directive and the .htaccess howto.

另请参阅AddType指令和.htaccess howto的文档。

#2


3  

You should be able to just add this line:

你应该可以只添加这一行:

AddType application/x-java-jnlp-file     .jnlp

#1


9  

AddType application/x-java-jnlp-file .jnlp

Note that you might not actually be allowed to do that.

请注意,您可能实际上不允许这样做。

See also the documentation of the AddType directive and the .htaccess howto.

另请参阅AddType指令和.htaccess howto的文档。

#2


3  

You should be able to just add this line:

你应该可以只添加这一行:

AddType application/x-java-jnlp-file     .jnlp