apache 如何将 MIME 类型添加到 .htaccess?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/33751/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How do I add a MIME type to .htaccess?
提问by Frank Krueger
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 .htaccessfile. Would someone please specify the complete contents of such a file?
我在共享主机上,所以我只能创建一个.htaccess文件。有人可以指定这样一个文件的完整内容吗?
采纳答案by J?rg W Mittag
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 directiveand the .htaccess howto.
另请参阅AddType 指令和.htaccess howto的文档。
回答by Ryan Guest
You should be able to just add this line:
您应该能够添加这一行:
AddType application/x-java-jnlp-file .jnlp

