2014-10-02 46 views
0

我有很多搜索,但我没有找到解决方案。字体真棒错误:资源解释为字体,但与MIME类型文本/ html传输

我用发电机的角度来生成项目,并有字体真棒参与,但我得到了镀铬警告

Resource interpreted as Font but transferred with MIME type text/html: "http://gview.com/fonts/fontawesome-webfont.svg?v=4.2.0" 

我注意到有一些规则生成的.htaccess文件来处理字体MIME类型,我不知道为什么它不能为我工作。

此外,我用ui.router的看法路线,并摆脱了#的目的,我在.htaccess添加一些规则如下:

RewriteEngine叙述上

# Don't rewrite files or directories 
    RewriteCond %{REQUEST_FILENAME} -f [OR] 
    RewriteCond %{REQUEST_FILENAME} -d 
    RewriteRule^- [L] 

    # Rewrite everything else to index.html to allow html5 state links 
    RewriteRule^index.html [L] 

我找不出错在哪里。

非常感谢。

回答

0

如果您使用Grunt为您的应用程序提供服务,则可能需要做一些小改动以允许其他文件扩展名通过。

connect: { 
     options: { 
      port: 9000, 
      // Change this to '0.0.0.0' to access the server from outside. 
      hostname: 'localhost', 
      livereload: 35729 
     }, 
     livereload: { 
      options: { 
       open: true, 
       middleware: function (connect) { 
        return [ 
         modRewrite(['!\\.html|\\.js|\\.svg|\\.css|\\.png|\\.woff|\\.ttf|\\.gif$ /index.html [L]']), 

检查您的Gruntfile中的modRewrite以确保您拥有所有需要的文件扩展名。

相关问题