.WOFF / .WOFF2 font files returning HTTP 404 error !! [Fix]
IIS is configured in such a way that it will deny request for any unexpected file types like .woff and .woff2. This is the reason it throws HTTP 404 Not Found error even though the files exist on server.
To verify, browse the webpage and do inspect element (by right clicking and selecting ‘Inspect’) .
To fix the error, we need to manually specify this file type in web.config of our web application. Add the following section inside <system.webserver> element –
<staticContent> <remove fileExtension=".woff" /> <mimeMap fileExtension=".woff" mimeType="application/x-font-woff" /> <remove fileExtension=".woff2" /> <mimeMap fileExtension=".woff2" mimeType="application/font-woff2" /> </staticContent>
Once this section is added, the site will no longer report the HTTP 404 error for these extensions.
Let us know through comments in case of any issue.
Thanks for checking out.
Please share\like and comment.