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

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

问题描述

我正在使用 Windows Azure 网站来托管一个 php 应用程序.我的应用程序使用 webfonts(css3 功能),我需要配置扩展名,例如 .eot;.woff 以避免 404 错误.我知道可以在 .net 应用程序中使用 web.config 设置这种配置,但是对于 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天全站免登陆