Search code examples
iishttp-status-code-404windows-server-2012

IIS Can't Serve .LDF or .MDF extensions


I'm trying to serve the extensions .ldf and .mdf and even though files of these types actually exist on the server, IIS keeps throwing 404 error whenever they are requested.

I've double checked IIS manager and both extensions are added MIME-types of application/octet_stream. Is there perhaps some other setting or place I've missed that needs something set?

Thanks for your help chaps.


Solution

  • Adding the following to web.config worked as suggested by Sergey Kornilov:

    <security>
      <requestFiltering>
        <fileExtensions>
          <remove fileExtension=".ldf" />
          <remove fileExtension=".mdf" />
        </fileExtensions>
      </requestFiltering>
    </security>