如何MIME类型添加到htaccess文件? [英] How to add mime types to an htaccess file?

查看:1110
本文介绍了如何MIME类型添加到htaccess文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题,添加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.

这篇关于如何MIME类型添加到htaccess文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆