How to add mime types to an htaccess file?

user1074378 picture user1074378 · Jul 6, 2012 · Viewed 8.8k times · Source

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?

Answer

guido picture guido · Jul 6, 2012

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.