Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

configure mime types windows azure websites php app

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?

like image 481
Thiago Custodio Avatar asked Dec 18 '13 16:12

Thiago Custodio


People also ask

How do I add MIME type to Azure App Service?

Configure MIME Types in App ServiceIn App Service Editor, find web. config and add . mp4 mimeMap: And that's it!

How do I change the MIME type file in Windows 10?

In the Connections pane, go to the site, application, or directory for which you want to add a MIME type. In the Home pane, double-click MIME Types. In the MIME Types pane, click Add... in the Actions pane. In the Add MIME Type dialog box, add the file name extension and MIME type, and then click OK.

How do I change my PHP version in Azure App Service?

Browse to your web app in the Azure Portal and click on the Settings button. From the Settings blade select Application Settings and choose the new PHP version. Click the Save button at the top of the Web app settings blade.

How do I host a PHP site on Azure?

Navigate to Repos tab in the Azure DevOps portal and navigate to the below path to edit the file. Scroll down to line number 11, select Edit , modify PHP to DevOps for PHP using Azure DevOps and choose Commit to save the changes to the code. Go to Builds tab under Pipelines. You should now see a build is in progress.


1 Answers

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>
like image 153
Thiago Custodio Avatar answered Oct 03 '22 02:10

Thiago Custodio