MIME sorts are file sorts – initially for e mail (“Multipurpose Web Mail Extensions”). However don’t simply consider them as “file sorts” as a result of MIME suggests a selected format for specifying them. For those who’ve ever written an HTML doc, you’re more likely to have specified a MIME sort. In all probability even with out realising it:
<model sort=”textual content/css” src=”/model.css” />
The sort attribute refers to a specific MIME sort.
Sometimes you may discover that your net server isn’t set as much as ship a selected file sort. And any requests for that sort of file simply don’t work. Normally, you may get round this by placing the MIME sort in your .htaccess file.
AddType textual content/richtext rtx
This directive has three space-separated elements:
You may affiliate a lot of totally different file extensions with the identical MIME sort on one line.
AddType video/mpeg mpg MPEG MPG
Need each hyperlink to a kind of file to routinely obtain, somewhat than simply open in your browser? Then, use the MIME sort software/octet-stream, like this:
AddType software/octet-stream pdf
As earlier than, you may embody quite a few file extensions:
AddType software/octet-stream rtf txt pdf docx doc
Right here’s an incomplete record of file codecs and related MIME sorts. For those who handle your individual web site, it’s possible you’ll already know your file sorts. Subsequently, you don’t want to stick the entire record into your .htaccess file. However in case you run a website with others who could possibly be importing all kinds of stuff, then sure. This may assist to keep away from any potential publishing mishaps. This notably pertains to file sharing or mission administration websites the place people are sure to be sharing numerous information.
AddType software/macbinhex-40 hqx
AddType software/netalive web
AddType software/netalivelink nel
AddType software/octet-stream bin exe
AddType software/oda oda
AddType software/pdf pdf
AddType software/postscript ai eps ps
AddType software/rtf rtf
AddType software/x-bcpio bcpio
AddType software/x-cpio cpio
AddType software/x-csh csh
AddType software/x-director dcr
AddType software/x-director dir
AddType software/x-director dxr
AddType software/x-dvi dvi
AddType software/x-gtar gtar
AddType software/x-hdf hdf
AddType software/x-httpd-cgi cgi
AddType software/x-latex latex
AddType software/x-mif mif
AddType software/x-netcdf nc cdf
AddType software/x-onlive sds
AddType software/x-sh sh
AddType software/x-shar shar
AddType software/x-sv4cpio sv4cpio
AddType software/x-sv4crc sv4crc
AddType software/x-tar tar
AddType software/x-tcl tcl
AddType software/x-tex tex
AddType software/x-texinfo texinfo texi
AddType software/x-troff t tr roff
AddType software/x-troff-man man
AddType software/x-troff-me me
AddType software/x-troff-ms ms
AddType software/x-ustar ustar
AddType software/x-wais-source src
AddType software/zip zip
AddType audio/fundamental au snd
AddType audio/x-aiff aif aiff aifc
AddType audio/x-midi mid
AddType audio/x-pn-realaudio ram
AddType audio/x-wav wav
AddType picture/gif gif GIF
AddType picture/ief ief
AddType picture/jpeg jpeg jpg jpe JPG
AddType picture/tiff tiff tif
AddType picture/x-cmu-raster ras
AddType picture/x-portable-anymap pnm
AddType picture/x-portable-bitmap pbm
AddType picture/x-portable-graymap pgm
AddType picture/x-portable-pixmap ppm
AddType picture/x-rgb rgb
AddType picture/x-xbitmap xbm
AddType picture/x-xpixmap xpm
AddType picture/x-xwindowdump xwd
AddType textual content/html html htm
AddType textual content/plain txt
AddType textual content/richtext rtx
AddType textual content/tab-separated-values tsv
AddType textual content/x-server-parsed-html shtml sht
AddType textual content/x-setext etx
AddType video/mpeg mpeg mpg mpe
AddType video/quicktime qt mov
AddType video/x-msvideo avi
AddType video/x-sgi-movie film
AddType x-world/x-vrml wrl