Search code examples
apachehttp-headersmime-types

Apache Server - Content-Type HTTP Header


Hi I am having an issue where the client side is unable to connect/play video content from a .mp4 asset file located on an Apache Server.

I am suspecting the issue has to do with the Content-Type parameter in the HTTP Headers.

How can I modify this Content-Type parameter to see if this is the issue?

I'd like to try video/mp4, audio/mp4, audio/m4a, audio/aac, etc.


Solution

  • To fix this issue on Apache you need to add the following content to the ‘.htaccess‘ file which is found in your document root (public_html or htdocs).

    just paste this to your .htaccess (required mime types)

    AddType video/mp4 mp4 m4v
    AddType audio/mp4 m4a
    

    You can also add these mime types directly in the Apache configuration file ‘mime.types’

    /etc/httpd/conf/mime.types
    

    add required mime.types.

      video/mp4 mp4 m4v
      audio/mp4 m4a
    

    then restart apache.