O'Reilly logo

Firefox Hacks by Nigel McFarlane

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Hack #27. Fix Web Servers to Support Firefox Content

Provide support for the bonus content types that Mozilla technology supports.

Firefox supports more varied content than just that of web pages. In addition to the big world of XUL-based applications, there are a number of configuration and security content types that can be delivered to the browser. This Hack explains how to set up Apache so that all these types are delivered with the right Content-Type. It also explains what to do about broken versions of Internet Explorer.

Configuring Firefox Content Types in Apache

The following MIME types are the ones most commonly used by Firefox. Update your Apache httpd.conf file to include these directives, and then restart httpd or signal it to reread the config files.

Support for HTML content types:

AddType application/xhtml+xml         .xhtml
AddType application/http-index-format .hti
AddType text/html                     .html
AddType text/css                      .css
AddType text/xsl                      .xslt
AddType application/x-javascript      .js

Support for other presentable XML content:

AddType application/xml               .xml /* or .. */
AddType text/xml                      .xml
AddType image/svg+xml                 .svg

Mozilla does not use the MIME type required for pure MathML; such content should be delivered inside a compound document identified as XHTML or XML.

Support for remote XUL and RDF:

AddType application/vnd.mozilla.xul+xml .xul
AddType application/rdf+xml             .rdf

Support for delivery of extensions, patches and configuration items:

AddType application/x-xpinstall .xpi AddType application/x-javascript-config ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required