Adding Mime Types to your Windows Azure Web Site

Have you ever noticed that some existing content is not serving from your Azure Web Site and returns the following message

“The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.”

One reason this may occur is due to missing MimeTypes.

To see if this is the case Enable Detailed Error Messages  in Site Diagnostics

image

After reproducing the issue gather the LogFiles/DetailedErrors folder for your site .

For A Mime Type issue you  will see that this is  404.3 error

 

image

In the above error I purposely omitted the “Things you can try” section as this applies to on premise IIS and in Web Sites you cannot run APPCmd.exe to add settings

Instead you can simply add this to the  web config . Here is any example for .woff extensions which I see quite often in Azure Web Site deployments

Add the following to the  <system.webServer>  section of your web.Config.

<staticContent>
<mimeMap fileExtension=".woff" mimeType="application/x-font-woff" />
</staticContent>

Note : If the <staticContent> element already exists you just need to add the <mimeMap> element  to this section for the type you want to add

No Comments