2016-07-18 28 views
0

我正在使用bootstrap,它工作正常,然後突然出現此錯誤無法加載資源:服務器的狀態爲404(未找到)http:// localhost:5266/Content/fonts/glyphicons-halflings-regular.woff2

無法加載資源:服務器與404狀態響應(未找到)http://localhost:5266/Content/fonts/glyphicons-halflings-regular.woff2

<link href="../Content/css/StyleSheet.css" rel="stylesheet" /> 
<link href="../Content/css/bootstrap.min.css" rel="stylesheet" /> 
<link href="../Content/css/bootstrap-theme.min.css" rel="stylesheet" /> 

<script src="../Script/js/jquery-2.2.1.min.js"></script> 
<script src="../Script/js/bootstrap.min.js"></script> 

請幫助我。

+0

檢查錯誤控制檯和發佈您的文件夾結構。 – vanburen

回答

0

嘗試將您的鏈接從../更改爲./

您可以參考這個answer,或搜索更多關於文件路徑。

0

我知道這個問題前一段時間被問到;我正在評論拯救別人的時間。

錯誤可能是因爲Web服務器的默認配置無法處理woff2的意外文件類型。

添加此web.config文件中, '配置' 標籤:

<system.webServer> 
    <staticContent> 
     <remove fileExtension=".woff2" /> 
     <mimeMap fileExtension=".woff2" mimeType="application/font-woff2" /> 
    </staticContent> 
</system.webServer> 

感謝:Will Strohl

相關問題