我正在使用Windows Azure網站託管一個PHP應用程序。我的應用程序使用webfonts(css3功能),我需要配置擴展名,例如.eot; .woff以避免404錯誤。我知道可以在.net應用程序中使用web.config設置這種配置,但對於php站點,我該怎麼辦?不幸的是,沒有RDP的網站。有沒有解決這個問題的另一種方法?配置MIME類型窗口天藍色的網站php應用程序
11
A
回答
26
我可以解決這只是添加一個web.config到根文件夾。
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<staticContent>
<remove fileExtension=".woff" />
<mimeMap fileExtension=".woff" mimeType="application/x-font-woff" />
<remove fileExtension=".ttf" />
<mimeMap fileExtension=".ttf" mimeType="application/octet-stream" />
<remove fileExtension=".svg" />
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
</staticContent>
</system.webServer>
</configuration>
0
對於任何人來到這裏,我也woff2文件哈德的問題,並得到了由添加此web.config文件的根擺脫錯誤的:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<staticContent>
<remove fileExtension=".woff" />
<mimeMap fileExtension=".woff" mimeType="application/x-font-woff" />
<remove fileExtension=".woff2" />
<mimeMap fileExtension=".woff2" mimeType="font/woff2" />
</staticContent>
</system.webServer>
</configuration>
通過使用捻服務將文件添加到wwwroot目錄中,如下所述: http://www.jamessturtevant.com/posts/How-to-add-edit-and-remove-files-in-your-azure-webapp-using-the-kudu-service-dashboard/
相關問題
- 1. 窗口天藍色和選擇項目類型上的雲
- 2. nodejs應用程序託管從天藍色的網站上的子文件夾
- 3. 配置MIME類型
- 4. 寧靜的天藍色網站
- 5. 如何設置蘋果應用程序網站協會的內容/ MIME類型作爲應用程序/ JSON
- 6. 設置在NewRelic的DNN 7天藍色的web應用程序
- 7. Log4net或azure登錄天藍色網站
- 8. 通過天藍色網站上的端口與傳統TCP IP應用程序進行通信
- 9. 無法從圖庫中設置天藍色的網站
- 10. 指定MIME類型的PHP文件作爲應用程序/ javascript
- 11. 蔚藍應用程序和零售網站的推薦設置
- 12. 爲什麼HTML文本的MIME類型是XHTML應用程序的MIME類型?
- 13. 在天藍色的網絡應用程序上的Wordpress網站重定向到404錯誤頁面
- 14. 如何將angular2應用程序部署爲天藍色的web應用程序
- 15. 的Apache/PHP設置MIME類型爲PHP
- 16. PHP上傳PDF MIME類型是應用程序/未知
- 17. 使用信用卡進行窗口天藍色驗證
- 18. 無法爲我的天藍色的web應用程序
- 19. 如何使天藍色的網站啓用https?
- 20. 連接到天藍色的服務結構應用程序
- 21. 找不到可變天藍色的移動應用程序
- 22. 如何備份天藍色的雲應用程序?
- 23. 無法連接並調試我的天藍色應用程序
- 24. 與天藍色的django應用程序失敗
- 25. 多租戶應用程序部署在後期的天藍色
- 26. 需要天藍色的應用程序邏輯條件幫助
- 27. 從天藍色的網絡應用程序發送電子郵件
- 28. 應用程序配置窗體窗體應用程序
- 29. 如何取消藍牙配置窗口
- 30. PHP網站上的Node.js應用程序
在對woff的mime類型產生了很多混淆之後,官方[W3規範](http://www.w3.org/TR/WOFF/#appendix- b)聲明它應該是「application/font-woff」而沒有「x-」。 –
這也適用於我與Windows Azure網站! – Simon
這真的幫助我,謝謝! –