Christoph
Christoph

Reputation: 2073

How to add Content/Type header to file without extension on Apache2

I want to add a 'Content/Type' header to a JSON file on the root of web directory. How to enforce adding the matching header if the file has no .json extension

Upvotes: 3

Views: 2788

Answers (1)

Christoph
Christoph

Reputation: 2073

Add this to your Apache config file:

<Files "FILENAME"> ForceType application/json </Files>

Upvotes: 5

Related Questions