如何MIME类型添加到htaccess文件?类型、文件、MIME、htaccess

2023-09-02 09:53:43 作者:人丑不能怪衣服i

我有一个问题,添加MIME类型到我的服务器。这是我目前的.htaccess:

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

但是,当我这样做,我得到一个500内部服务器错误。然后,我REUP .htaccess文件没有将AddType行并能正常工作了。可能是什么问题?

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?

推荐答案

您需要

AllowOverride FileInfo

在你的虚拟主机的配置并为目录中.htaccess文件的位置,以便能够使用将AddType 指令。

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