Fontawesome does not work when served by IIS

后端 未结 10 683
梦谈多话
梦谈多话 2021-01-02 17:10

FontAwesome does not work for me when I put my app on IIS7 server.

In Firefox the requested URL is encoded to http://l2etest.kema.intra/fonts/fontawesome-webfo

相关标签:
10条回答
  • 2021-01-02 17:33

    This Answer is not for the above problem But for those who face similar error but due to different reason and land up into this thread.

    I faced similar problem but later found that IIS was trying to look for font-awesome woff,eot files in the folder MyIpAddress/fonts/fontawesome-webfont.woof but I had the files in different folder. Moving the fontawesome-webfont.eot, fontawesome-webfont.svg,fontawesome-webfont.ttf, fontawesome-webfont.woff into my fonts folder solved my problem

    0 讨论(0)
  • 2021-01-02 17:33

    Use this cdn in your index.html page...

     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
    
    0 讨论(0)
  • 2021-01-02 17:34

    You can open IIS, point to your website, In IIS session, select MIME Types. After Mime Types view showing, click Add -> In dialog:

    • File name extension: .woff
    • MiME types: application/x-font-woff

    click OK.

    Done.

    0 讨论(0)
  • 2021-01-02 17:36

    I changed from woff2 to woff and it went on fine.

    0 讨论(0)
  • 2021-01-02 17:38

    If you're adding FontAwesome via bundling, it can throw out the woff2 url. See the following solution on a similar thread where CssRewriteUrlTransform is used to rework the url: https://stackoverflow.com/a/22700610/746984

    0 讨论(0)
  • 2021-01-02 17:39

    Playing with IIS sever is risky, instead of that I tried another trick which was 100% success.

    Step 1

    Rename the font files names by adding .jpg at the end of the files.

    fontawesome-webfont.eot.jpg (likewise)

    Then Change the File types in fontawesome.css font rendering lines

     */@font-face{font-family:'FontAwesome'; src:url('../fonts/fontawesome-webfont.eot.jpg?v=4.0.3'); src:url('../fonts/fontawesome-webfont.eot.jpg?#iefix&v=4.0.3') format('embedded-opentype'),url('../fonts/fontawesome-webfont.woff.jpg?v=4.0.3') format('woff'),url('../fonts/fontawesome-webfont.ttf.jpg?v=4.0.3') format('truetype'),url('../fonts/fontawesome-webfont.svg.jpg?v=4.0.3#fontawesomeregular') format('svg');
    
    0 讨论(0)
提交回复
热议问题