How do I add a MIME type to .htaccess?

岁酱吖の 提交于 2019-12-10 12:43:46

问题


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

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

That is the Tomcat format.

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?


回答1:


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.




回答2:


You should be able to just add this line:

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


来源:https://stackoverflow.com/questions/33751/how-do-i-add-a-mime-type-to-htaccess

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!