How to add Mime-Types using .htaccess

In the event you are hosting elsewhere, and your web hosting account is not configured to serve certain mime types with the
proper content type, or you want to alter the defaults, you can change this using .htaccess file.

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
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Can you provide a custom package for me?

Yes, most definitely. Simply open up a helpdesk ticket in the Sales department or contact us...

Redirect URLs using .htaccess

Sometimes you need to redirect some URL and/or page on your site to another one.The feature is...

Force SSL/https using .htaccess and mod_rewrite

Sometimes you may need to make sure that the user is browsing your site over a secure...

Change PHP variables using .htaccess

If you need to change the way your PHP is working you can do that using .htaccess.Please, note...

Block Bad robots, spiders, crawlers and harvesters

There are lots of examples across the internet that use ModRewrite. We will provide such an...