John Raptis
John Raptis

Reputation: 197

Setting the mime-type for one specific file (which has a blank extension!)

I'm trying to make a universal URL link work on iOS. Apple wants me to put a file called "apple-app-site-association" in a specific place on my server. So far so good.

However, in the interests of making things harder than they need to be, Apple ALSO wants me to serve this file with mime type application/json.

I'm trying to do it by putting this in htaccess:

<Files apple-app-site-association>
AddType application/json .
</Files>

But... looks like apache doesn't want to play .htaccess with a blank file extention. Can anyone clue me in on how I can solve the Apple Sphinx's riddle, with hopefully the same results Theseus got? How do I serve this blank extension file as application/json??? I'm using httpd on CentOS 8.

Upvotes: 0

Views: 405

Answers (1)

John Raptis
John Raptis

Reputation: 197

The solution:

<Files "apple-app-site-association">
ForceType application/json
</Files>

There's a couple solutions for this on the web with formatting that causes internal server errors. So putting this up on the web for posterity.

Upvotes: 1

Related Questions