Home
 

Customer Support

Search for keywords:

Browse by category:

How can I make apache recognize different MIME
types?

You use one or more AddType directives in an .htaccess file located in or above the directory where you want the new types to be recognized.

The .htaccess file is just a plain text file with 1 directive per line like:
AddType text/html .html
AddType image/gif .gif
The AddType directive is fully documented at http://httpd.apache.org/docs/mod/mod_mime.html#addtype

User-Contributed Notes

add a note
27-Mar-2007 23:10
If you want to let people download an OpenOffice document with an .odt
extension and are having a problem with binary data from the document
opening inside the browser, just add the following directive to  an
.htaccess file located above all the directories where you want it to
operate:

   AddType application/vnd.oasis.opendocument.text .odt

Doing that will change the behavior to make the user's browser prompt to
either open the document with OpenOffice (or some other application) or
"Save to Disk."

06-Aug-2009 23:36
To prevent .docx documents from being displayed in browsers you can add
the following to a .htaccess which should force the browser to download
the file as opposed to display it:

 AddType 
application/vnd.openxmlformats-officedocument.wordprocessingml.document
.docx

More info:
http://technet.microsoft.com/en-us/library/cc179224.aspx


add a note

Related Questions:


Why does my website just say "Error 403 Forbidden"?

How do I protect a directory with .htaccess?

How can I show a default page other than index.html?

How do I stop people from getting directory listings when I dont have an index page?

What do the different HTTP Status Codes like 200, 304, 404, 401, 403 mean?

How do I protect a directory with mod_auth_mysql?

What options are configured with Apache and what can I do with .htaccess files?

How do I stop other websites from using my bandwidth while they steal images, flash, etc. from my site?

Which Apache modules are installed?

How do I make my own Error Documents to replace the default ones like 404 Not Found?

The webservers' Gzip compression is messing up my XML or Flash files for Netscape 4 browsers. How do I turn off compression?

How do I get different character sets to display correctly?

Why am I getting a 412 Precondition Failed from a website?

What webserver do you run?

Will I have access to raw logfiles?

My mod_rewrite rules make my website stop loading.

I created a symbolic link, and now I am getting a 404 errors.

How do I stop the server from automatically correcting spelling mistakes in URLs or offering multiple choices for documents?

How do I protect my website from comment spam?

How do I redirect traffic to another web page?

How do I enforce the use of SSL on my website?

Why do my mod_security rules cause intermittent Internal Server Errrors?

How can I make it clear to search engines that mydomain.com and www.mydomain.com are the same site?

Browse Categories:

Getting Started, FTP, Telnet/SSH, Moving Domains, E-mail, Traffic Reports, Mailing Lists, Apache, PHP, CGI, Other Server-Side Scripting, MySQL Database, Imaging Libraries, Other Software, Billing & Terms, Control Panel, E-commerce, Pre-Sales


Modwest PHP Hosting      Copyright 2000-2009 by Modwest, Inc.      About    |    Blog    |    Community    |    Design    |    Jobs    |    Contact