Pivotal Knowledge Base

Follow

XML files ending in .htm are interpreted as HTML files in Apache HTTP Server, vFabric Enterprise Ready Server and vFabric Web Server (2010627)

XML files ending in .htm are interpreted as HTML files in Apache HTTP Server, vFabric Enterprise Ready Server and vFabric Web Server (2010627)

Symptoms

  • Files ending with the .htm extension and contain XML data are interpreted as as HTML files in Apache HTTP Server, vFabric Enterprise Ready Server (ERS) and vFabric Web Server
  • The files ending with the .htm extension and contain XML data are displayed incorrectly

Cause

This issue is caused by the Type handler associated with the .htm extension.

Resolution

Files with the .htm extension are, by default, interpreted as text/html by httpd.
 
You can change the way a file is treated by editing the conf/mime.types file. The default entry for .htm files in the conf/mime.types file is:

text/html html htm

In this file, you can add or delete file extensions as required. For example, if you do not want files with the .htm extension to be interpreted at text/html, you can change this entry to:

text/html html

If you want to use your own mime.types file, you can change this in the main httpsd.conf using the TypesConfig Directive. For more information on TypesConfig, see http://httpd.apache.org/docs/current/mod/mod_mime.html#typesconfig.

Alternatively, you can also change the file extension to something that will not be interpreted at text/html. .html and .htm are the default files extensions for type text/html.
 
ERS 4.0.x and vFabric Web Server both contain this handler for XML files that you may want to use:
 
application/xml xml xsl

Additional Information

This issue may also occur with any file with an extension. For example, Javascript files have the .js extension and can cause issues in older browsers if the MIME module is not loaded or the definition in the mime.types file has been changed. For more information on how httpd interprets filename extensions, see http://httpd.apache.org/docs/2.2/mod/mod_mime.html.
©VMware 2013

Comments

Powered by Zendesk