Search code examples
htmlapache.htaccessmime-typesadd-type

How to add mime types to an htaccess file?


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?


Solution

  • 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.