What web.config setting will allow apple-app-site-association to be served?

ToddBFisher picture ToddBFisher · Jan 13, 2017 · Viewed 7.3k times · Source

I have added the apple-app-site-association file to the root of a website, but IIS is not delivering the file.

What is the best way to make the server serve this specific file without a file extension? Is there a way within a web.config to explicitly say "serve this file"?

Answer

mogile_oli picture mogile_oli · Jul 6, 2017

I was having the same issue and found this amazing post:

Serving apple-app-site-association from IIS IIS only serves files of known types, defined by their file extension. Since apple-app-site-association doesn’t include a file extention, IIS throws a 404 error, when I try to open it with a browser. I fixed this by adding a mimeMap in the web.config file:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.webServer>
    <staticContent>
      <!-- required for apple-app-site-association: -->
      <mimeMap fileExtension="." mimeType="application/json" />
    </staticContent>
  </system.webServer>
</configuration>