Returning the application content type / json for .json files on RHEL / Apache

The OS is, in particular, RHEL6, working with Apache2.

So, in my Apache configuration, I have:

LoadModule mime_module modules/mod_mime.so

And in /etc/mime.typesI have the following:

application/json                                json

However, when requesting a file with the extension .json(and containing a valid JSON), the content type is set to text/html. Any idea how I can get the correct header for this file type?

+5
source share
1 answer

Use the directive AddTypein apache configuration:

AddType / json.json Application

+11
source

All Articles