title: asp.net core - How to serve static file with no extension
body: <p>ASP.NET Core hapily serves up files from the <code>wwwroot</code> folder based on the mime type of the file. But how do I get it serve up a file with no extension?</p>
  
  <p>As an example, Apple require that you have an endpoint in your app <code>/apple-app-site-association</code> for some app-intergration. If you add a text file called apple-app-site-association into your wwwroot it won't work.</p>
  
  <p>Some things I've tried:</p>
  
  <p>1) Provide a mapping for when there's no extension:</p>
  
  <pre><code>var provider = new FileExtensionContentTypeProvider();
  provider.Mappings[""] = "text/plain";
  app.UseStaticFiles(new StaticFileOptions
              {
                  ContentTypeProvider = provider
              });
  </code></pre>
  
  <p>2) Adding an app rewrite:</p>
  
  <pre><code>var options = new RewriteOptions()
  .AddRewrite("^apple-app-site-association","/apple-app-site-association.txt", false)
  </code></pre>
  
  <p>Neither work, the only thing that does work is a <code>.AddRedirect</code> which I'd rather not use if possible.</p>