配置MIME类型的Windows Azure网站PHP应用程序 [英] configure mime types windows azure websites php app

查看:137
本文介绍了配置MIME类型的Windows Azure网站PHP应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是Windows Azure的网站主办的PHP应用程序。我的应用程序使用网络字体(CSS3功能),我需要配置扩展,如.eot; .woff避免404错误。我知道,它可以设置这样一个.NET应用程序中使用的web.config的configs,但对于一个PHP的网站,我该怎么办?不幸的是有没有RDP的网站。有另一种方式来解决这个问题?

I'm using Windows Azure Websites to host a php app. My app uses webfonts (css3 feature) and I need to configure extensions such as .eot; .woff to avoid 404 errors. I know that it's possible to set this kind of configs using web.config in a .net app, but for a php site, what can I do? Unfortunately there's no RDP for websites. Is there another way to solve this?

推荐答案

我可以解决这个只是增加一个web.config中根文件夹。

I could solve this just adding a web.config to root folder.

<?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>

这篇关于配置MIME类型的Windows Azure网站PHP应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆