I upgraded from Apache 2.2 to 2.4 on a RedHat 6.4 server and ran into a mime type problem.
Apache has a default directive . In Apache 2.2, I set this value to "text / plain". I have a web page that lists all the files in this directory, and the user can click to view the files. This directory contains all types of different file extensions and some files without extensions. When a file is clicked, it will open in a new window, well formatted. No code does this. It is strictly a browser that opens a file and decides what to do by its type of content.
This directive is disabled in Apache 2.4. On the Apache documentation website, the user is prompted to use the mime.types and AddType Directive configuration file to configure media types.
My question is how to assign a mime type of type "text / plain" to files without extension? In Apache 2.2, these files will be assigned the default text / regular content type using the DefaultType directive. In Apache 2.4, I cannot figure out how to do this, since I can no longer use this directive. I do not want to use ForceType Directive because it will override other mime types that are already defined.
I could create a php wrapper that downloads the file and assigns a content type, but I would prefer to keep the logic in apache, where all the other definitions of the mime type are located.
Any help would be greatly appreciated. If you need more information, please let me know.
source share