--- NB: Go to the EDITED 2 section for summary ----
I have an ASP.NT MVC (4) application. I integrated (twitter)Bootstrap to it. Bootstrap is working perfectly, but the
IIS doesn't know how to handle (serve) those files (MIMEs).
Add this to your system.webServer node in the web.config file and you'll be golden:
<staticContent>
<mimeMap fileExtension=".otf" mimeType="font/otf" />
<mimeMap fileExtension=".woff" mimeType="font/x-woff" />
<!-- add more MIMEs if needed... -->
</staticContent>
--Edited, see Ryans and mine comment below: Even better, to be safe, remove and add the mime type maping:
<staticContent>
<remove fileExtension=".otf" />
<mimeMap fileExtension=".otf" mimeType="font/otf" />
<remove fileExtension=".woff" />
<mimeMap fileExtension=".woff" mimeType="font/x-woff" />
<!-- add more MIMEs if needed... -->
</staticContent>
You have to set the property Copy to Output Directory of the files on Copy always
I was also having this issue with MVC 5 and Bootstrap v3.3.6.
Failed to load resource: the server responded with a status of 404 (Not Found) http://NameOfSite/Error/NotFound?aspxerrorpath=/bundles/fonts/glyphicons-halflings-regular.woff2
You need to update the @icon-font-path
in theContent/bootstrap/variables.less
file from "../fonts/";
to "/Content/fonts/";
Have you included your bootstrap files into the project? Only the files, included into the solution are to be published.
I had this problem too. Rather than have to move files around you can create a virtual directory in the root of the project in IIS.