Skip to Content

TheBlogReaders.com

Salesforce.com, PHP, MySQL, Javascript, Ajax, Htacces

How to add Mime-Types using .htaccess

Be First!
by April 7, 2011 HTACCESS

How to add Mime-Types using .htaccess

In case your web hosting account is not configured to server certain mime types with the proper content type. You can change this using .htaccess file.

Example :

AddType application/x-shockwave-flash swf
AddType specified you are adding a new mime type (file type).
application/x-shockwave-flash is the actual mime parameter specs.
swf is the extension of the file type.

For example if you need to configure your server to display ASX files:

AddType video/x-ms-asf asf asx

For windows media audio WMA

AddType audio/x-ms-wma .wma

A comprehensive list of mime-types can be found here

There is one more useful feature of the AddType directive. Most of you most probably know that Internet Explorer opens MS Word, Excell, PDF and some other files inside a browser window. To force the browser to download the file you can use AddType to change the document type:

AddType  application/octet-stream  .doc .xls .pdf

(439)

Previous
Next

Leave a Reply