How to fix 'woff and ttf fonts 404 not found'
By FoxLearn 2/18/2024 12:58:45 AM 289
"Failed to load resource: the server responded with a status of 404 (Not Found)" or "woff2?v=4.3.0 Failed to load resource" with fontawesome-webfont.woff, fontawesome-webfont.woff2, glyphicons-halflings-regular.woff, glyphicons-halflings-regular.woff2.
If you haven't got files, i think you should download then copy to your project. First ensure that you copy all files to webserver, In Visual Studio you can click each of file then select properties->copy always
Second you need to open the Web.config file then add a config as below
<staticContent> <remove fileExtension=".woff" /> <mimeMap fileExtension=".woff" mimeType="application/font-woff" /> <remove fileExtension=".woff2" /> <mimeMap fileExtension=".woff2" mimeType="font/x-woff" /> </staticContent>
Now, Start your project again then select inspect->tab network you can see no error throw a 404 not found error on woff or woff2 files when requesting the .woff, .ttf, .woff2 files
- How to use CORS in ASP.NET Core
- How to Send Emails in ASP.NET Core
- How to Run Background Tasks in ASP.NET Core with Hosted Services
- Implementing Scheduled Background Tasks in ASP.NET Core with IHostedService
- Creating an Web API in ASP.NET Core
- 8 Essential Tips to Protect Your ASP.NET Core Application from Cyber Threats
- 10 Common Mistakes ASP.NET Developers Should Avoid
- How to Upload Files Using C# ASP.NET FileUpload Control