Partager via


Removing MIME Types from a Web site or directory

Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1

If you do not want to serve files with certain extensions from a Web site or directory, you can remove the related MIME types from the list of MIME types registered for that particular Web site or directory.

If you use IIS Manager to remove a MIME type mapping, you must also verify that the MIME type does not exist in the registry at HKEY_CLASSES_ROOT\extension. If the MIME type also exists in the registry, you must remove it. If the MIME type continues to exist in the registry, files with that extension continue to be served. Be aware, however, that if you remove a MIME type mapping from the registry, other applications may be affected, because the registry database is shared by multiple applications.

Procedures

Important

You must be a member of the Administrators group on the local computer to perform the following procedure or procedures. As a security best practice, log on to your computer by using an account that is not in the Administrators group, and then use the runas command to run IIS Manager as an administrator. At a command prompt, type runas /user:Administrative_AccountName "mmc %systemroot%\system32\inetsrv\iis.msc".

To remove a MIME type from a Web site or directory

  1. In IIS Manager, right-click the Web site or Web site directory from which you want to remove a MIME type, and click Properties.

  2. Click the HTTP Headers tab.

  3. Click MIME Types.

  4. From the Registered MIME types list, click the MIME type you want to remove, and then click Remove.

  5. Click OK.

For information about the inheritance and merge behavior of MIME types, see MIME Types.