问题
When I try to statically use font-awesome (fa) in my project with Apache 2.4.x the icons will not show up. Fa works with apache 2.2.x, and Python's SimpleHHTPServer.
This is not the IE/Firefox issue where a box is displayed instead of the icon.
I am using this in Dreamfactory (OSX), but I have also tried vanilla Apache from MacPorts with the same results.
Chrome's console reports the following when the page loads:
Resource interpreted as Stylesheet but transferred with MIME type text/troff: "http://localhost:8080/files/applications/CADRe/bower_components/font-awesome/css/font-awesome.min.css".
Fa was installed with bower and I am including it like this:
<link href="bower_components/font-awesome/css/font-awesome.min.css" rel="stylesheet">
My project also includes angularjs and bootstrap.
回答1:
When you run the DreamFactory admin console, do you see icons? Those use the Bootstrap CDN to serve up font awesome.
This could be an apache config issue , in which case you'd need to edit your apache config to support the mime type:
AddType application/vnd.ms-fontobject eot
AddType font/truetype ttf
AddType application/x-font-woff woff
I would put this as a comment, but this is a new account, and I'm disallowed.
回答2:
Add css with full path and above provided add font mytype in either .htaccess or apachec config file
<link href="http://localhost:8080/files/applications/CADRe/bower_components/font-awesome/css/font-awesome.min.css" rel="stylesheet">
In .htaccess
AddType application/vnd.ms-fontobject eot
AddType font/truetype ttf
AddType application/x-font-woff woff
来源:https://stackoverflow.com/questions/23721799/font-awesome-not-working-with-apache-2-4-x