I have this error both on my production IIS7 server and on local iisexpres (after I've set debug="false"
)
GET http://localhost:64231/font/fontawesome-webfont.woff?v=3.2.1 404 (Not Found) jquery-1.11.0.min.js:2
GET http://localhost:64231/font/fontawesome-webfont.ttf?v=3.2.1 404 (Not Found) localhost/:1
GET http://localhost:64231/font/fontawesome-webfont.svg 404 (Not Found)
I've added mime types to web.config. Also I've added they to IIS
<remove fileExtension=".woff" />
<mimeMap fileExtension=".woff" mimeType="application/x-font-woff" />
<remove fileExtension=".svg" />
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
<remove fileExtension=".ttf" />
<mimeMap fileExtension=".ttf" mimeType="application/x-font-ttf" />
What am I doing wrong?
When you set debug value to false, it will automatically enable optimisations for the bundles. Instead of having, in your html generated code (by example) :
<link href="/content/bootstrap-3.3.5.min.css" rel="stylesheet"/>
<link href="/content/font-awesome.min.css" rel="stylesheet"/>
You will have something like this :
<link href="/Styles?v=ca92niiBlGWlTNkBwoMTPgQGz9_5Ghi39pZxcx5Dyfk1" rel="stylesheet"/>
This is why your paths are not correct anymore. I think setting absolute paths is a correct way to resolve this problem.
If you don't want to automatically enable optimization when your application is in release mode (debug="false"
), you can add this line to your file /App_Start/BundleConfig.cs
:
BundleTable.EnableOptimizations = false;
EDIT : I just seen the date of your question... I came here because I ran into the same issue yesterday. I hope my explanation will help somebody.
The problem was in relative path to fonts. I've replaced it with absolute path url('/content/FontAwesome/font/...');
all last responses don't work for me. I can see that the url requested by the page to the resource is like 'YourWebsite/fonts/fontawesome-webfont.woff2?v=4.7.0'
Then i decide generate the fontawesome bundle with the path "~/bundles/fonts"
bundles.Add(new StyleBundle("~/bundles/fonts") .Include("~/Content/font-awesome.css", new CssRewriteUrlTransform()));
then worked for me
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With