You can use .htaccess
to define your own MIME types. What this means is you can associated file types with actions to be performed.
How do you use this? Let’s stay you want .DOC
files to be interpreted as .TXT
files. Modify the lines below:
AddType text/plain .txt
To:
AddType text/plain .txt .doc
You must perform an additional step if your server only supports the .SHTML
file type for SSI files and you want a .HTML
file to also perform SSI. Simply modify the MIME type from:
AddType text/html .html .htm AddType text/x-server-parsed-html .shtml .sht
To:
AddType text/html .htm AddType text/x-server-parsed-html .shtml .sht .html AddHandler server-parsed .shtml .sht .html
Note the use of the “AddHandler” optoin to indicate the server side handlers.
Use this with caution, as ALL files with a .HTML
file type will be interpreted as .SHTML
. You can see, however, how convenient this can be.
The table below shows each of the MIME types and some of the associations.
AddType text/html .html .htm AddType text/plain .txt AddType text/richtext .rtx AddType text/tab-separated-values .tsv AddType text/x-setext .etx AddType text/x-server-parsed-html .shtml .sht AddType application/macbinhex-40 .hqx AddType application/netalivelink .nel AddType application/netalive .net AddType application/news-message-id AddType application/news-transmission AddType application/octet-stream .bin .exe AddType application/oda .oda AddType application/pdf .pdf AddType application/postscript .ai .eps .ps AddType application/remote-printing AddType application/rtf .rtf AddType application/slate AddType application/zip .zip AddType application/x-mif .mif AddType application/wita AddType application/wordperfect5.1 AddType application/x-csh .csh AddType application/x-dvi .dvi AddType application/x-hdf .hdf AddType application/x-latex .latex AddType application/x-netcdf .nc .cdf AddType application/x-sh .sh AddType application/x-tcl .tcl AddType application/x-tex .tex AddType application/x-texinfo .texinfo .texi AddType application/x-troff .t .tr .roff AddType application/x-troff-man .man AddType application/x-troff-me .me AddType application/x-troff-ms .ms AddType application/x-wais-source .src AddType application/x-bcpio .bcpio AddType application/x-cpio .cpio AddType application/x-gtar .gtar AddType application/x-shar .shar AddType application/x-sv4cpio .sv4cpio AddType application/x-sv4crc .sv4crc AddType application/x-tar .tar AddType application/x-ustar .ustar AddType application/x-director .dcr AddType application/x-director .dir AddType application/x-director .dxr AddType application/x-onlive .sds AddType application/x-httpd-cgi .cgi AddType image/gif .gif .GIF AddType image/ief .ief AddType image/jpeg .jpeg .jpg .jpe .JPG AddType image/tiff .tiff .tif AddType image/x-cmu-raster .ras AddType image/x-portable-anymap .pnm AddType image/x-portable-bitmap .pbm AddType image/x-portable-graymap .pgm AddType image/x-portable-pixmap .ppm AddType image/x-rgb .rgb AddType image/x-xbitmap .xbm AddType image/x-xpixmap .xpm AddType image/x-xwindowdump .xwd AddType audio/basic .au .snd AddType audio/x-aiff .aif .aiff .aifc AddType audio/x-wav .wav AddType audio/x-pn-realaudio .ram AddType audio/x-midi .mid AddType video/mpeg .mpeg .mpg .mpe AddType video/quicktime .qt .mov AddType video/x-msvideo .avi AddType video/x-sgi-movie .movie AddType message/external-body AddType message/news AddType message/partial AddType message/rfc822 AddType multipart/alternative AddType multipart/appledouble AddType multipart/digest AddType multipart/mixed AddType multipart/parallel AddType x-world/x-vrml .wrl