Modifying or Adding Custom MIME Types to Windows Hosting Accounts
Using a Windows hosting account running IIS 7 or 8, you can modify or add MIME types. This lets you specify how Web browsers handle file extensions. Your hosting account already handles a number of different MIME types. For more information, see What MIME types does my Windows hosting account support by default?.
How you work with MIME types depends on what kind of hosting account you have (more info).
Web/Classic (Hosting Control Panel)
To modify or add custom MIME types, you must create or edit your account's web.config
file. For more information about web.config
files, see ASP.NET's Web.Config Basics.
To Modify Existing MIME Types
Create or edit a web.config
file in your account's root directory to include the following:
<system.webServer>
<staticContent>
<remove fileExtension=".EXTENSION" />
<mimeMap fileExtension=".EXTENSION" mimeType="TYPE/SUBTYPE" />
</staticContent>
</system.webServer>
</configuration>
Enter your own values for EXTENSION
, TYPE
, and SUBTYPE
, where:
EXTENSION
is the file extension you want to serve to the browserTYPE
is the MIME type you want to use, such asapplication
,image
, orvideo
SUBTYPE
is the MIME subtype you want to use
For example, you could use this code in your web.config
file, if you want to add MP4 files to your website:
<system.webServer>
<staticContent>
<remove fileExtension=".mp4" />
<mimeMap fileExtension=".mp4" mimeType="video/mp4" />
</staticContent>
</system.webServer>
</configuration>
To Add Custom MIME Types
Create or edit a web.config
file in your account's root directory to include the following:
<system.webServer>
<staticContent>
<mimeMap fileExtension=".EXTENSION" mimeType="TYPE/SUBTYPE" />
</staticContent>
</system.webServer>
</configuration>
Enter your own values for EXTENSION
, TYPE
, and SUBTYPE
, where:
EXTENSION
is the file extension you want to serve to the browserTYPE
is the MIME type you want to use, such asapplication
,image
, orvideo
SUBTYPE
is the MIME subtype you want to use
Windows (Plesk)
Plesk has a built-in MIME type setting feature.
To Add or Modify MIME Types
- Log in to your Account Manager.
- Click Web Hosting.
- Next to the hosting account you want to use, click Manage.
- At the bottom of the section of the domain hosting you want to use, click Show More.
- Click Web Server Settings.
- In the MIME types section, select Enter custom value.
- Enter the MIME types you want to use, and then click OK.