How to add Mime-Types using .htaccess
Web Hosting Articles »
A simple guide to .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.
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
- How to block users from accessing your site based on their IP address
- How to prevent or allow directory listing?
- How to change the error documents – 404 Page Not Found, etc
- Using .htaccess for password protecting your folders
- Using .htaccess to block referrer spam
- Disable Hot-Linking of images and other files
- Redirect URLs using .htaccess
- Introduction to mod_rewrite and some basic examples
- Force SSL/https using .htaccess and mod_rewrite
- 301 Permanent redirects for parked domain names
- Enable CGI, SSI with .htaccess
- How to add Mime-Types using .htaccess
- Change default directory page
- Block Bad robots, spiders, crawlers and harvesters
- Make PHP to work in your HTML files with .htacess
- Change PHP variables using .htaccess
- HTTP Authentication with PHP running as CGI/SuExec
- Force www vs non-www to avoid duplicate content on Google
- Duplicate content fix index.html vs / (slash only)
Leave a comment >>
| Previous: Enable CGI, SSI with .htaccess | Next: Change default directory page |
