I am running a WordPress site as an app in Azure. My Azure site has a web.config file that I need to add an additional rule to allow for .mp4. When I have tried I have managed only to get a server error. Here is what my current file looks like:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <rewrite>
      <rules>
            <rule name="WordPress: http://mysitename.azurewebsites.net" 
patternSyntax="Wildcard">
                <match url="*"/>
                    <conditions>
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/>
                    </conditions>
                <action type="Rewrite" url="index.php"/>
            </rule></rules>
    </rewrite>
  </system.webServer>
</configuration>

The rule I need to add to the above is:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <staticContent>
               <mimeMap fileExtension=".mp4" mimeType="video/mp4" />
               <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="7.00:00:00" />
     </staticContent>
    </system.webServer>
</configuration>

I’m not sure what I’m missing, I’ve tried to add the above rule to the web.config file everyway I know how and I’m still getting an error. There’s obviously something I’m doing wrong in the syntax. Any help greatly appreciated.

Read more here: Editing web.config for Microsoft Azure Web App


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: