MIME Types Using .htaccess

Here we going to see MIME types using .htaccess. MIME is short for Multipurpose Internet Mail Extensions, But also modern MIME types apply to other services in addition to email. The MIME types help to identify what a file is or what file type is. Here the example, MIME types can assist a browser to determine what type of content is about to be processed so the browser can do the proper controls, media player or plugins to display the data perfectly.
The following instruction will help you to do in a proper way. For this first create a .htaccess file and add the following code.
1 2 |
# HTML # AddType text/html .html .htm |
The first “AddType” defines that you are adding a MIME type. The second section is the MIME type in this case text or HTML and the last one is an extension of the file ( example “.html”).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# HTML # AddType text/html .html .htm # (SSI) Server Side Includes # AddType text/html .shtml # CSS # AddType text/css .css # XHTML # AddType application/xhtml+xml .xhtml # XML # AddType text/xml .xml # Active Server Pages # AddType text/html .asp # Favicons # AddType image/vnd.microsoft.icon .ico # IMAGES # AddType image/gif .gif .GIF AddType image/x-xpixmap .xpm AddType image/x-portable-anymap .pnm AddType image/jpeg .jpeg .jpg .jpe .JPG AddType image/x-portable-graymap .pgm AddType image/tiff .tiff .tif AddType image/x-cmu-raster .ras AddType image/x-rgb .rgb AddType image/x-portable-bitmap .pbm AddType image/ief .ief AddType image/x-portable-pixmap .ppm AddType image/x-xwindowdump .xwd AddType image/x-xbitmap .xbm # SVG # AddType image/svg+xml .svg .svgz # Adobe PDF # AddType application/pdf .pdf # Real # AddType audio/x-pn-realaudio-plugin .rpm AddType audio/vnd.rn-realaudio .ra .ram AddType video/vnd.rn-realvideo .rv AddType application/vnd.rn-realmedia .rm # Microsoft multimedia # AddType application/x-ms-wmz .wmz AddType application/x-ms-wmd .wmd AddType audio/x-ms-wma .wma AddType audio/x-ms-wax .wax AddType video/x-ms-wmv .wmv AddType video/x-ms-wvx .wvx AddType video/x-ms-asf .asf .asx AddType video/x-ms-wm .wm AddType video/x-ms-wmx .wmx # MPEG # AddType audio/x-mpegurl .m3u # Binary Compressed files and archives # AddType application/octet-stream .dmg .bin .exe AddType application/zip .zip AddType application/x-gtar .gtar AddType application/x-rar-compressed .rar AddType application/x-gzip .gz # Java # AddType application/x-java-applet .class # Quicktime movies # AddType video/quicktime .mov .qt # XBM files # AddType image/x-xbitmap .xbm # WAV files # AddType audio/x-wav .wav # Macromedia # AddType application/x-authorware-seg .aas AddType application/x-authorware-bin .aab AddType application/x-shockwave-flash .swf AddType application/x-director .dir .dcr .dxr .fgd AddType image/x-freehand .fh4 .fh5 .fh7 .fhc .fh AddType application/x-authorware-map .aam |
Mraj
Creative Designer & Developer specialist by the spirit and a loving blogger by thoughts. If you have any questions let me drop an email with the article name to the following email id: [email protected]