How to add mime types to an htaccess file?

老子叫甜甜 提交于 2019-12-20 01:08:12

问题


I'm having an issue adding a mime type to my server. This is my current .htaccess:

AuthUserFile /usr/local/www/pass/.htpasswd
AuthType Basic
AuthName "Mockups"

<LIMIT GET POST>
require valid-user
</LIMIT>

I want to add this:

AddType audio/mpeg .mp3

But when I do, I get a 500 Internal Server Error. I then reup the .htaccess file without the "AddType" line and it works fine again. What could be the issue?


回答1:


You need

AllowOverride FileInfo

in your virtualhost configuration and for the directory in which the .htaccess file is located, to be able to use AddType directive.



来源:https://stackoverflow.com/questions/11365852/how-to-add-mime-types-to-an-htaccess-file

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