Overriding Apache test/plain MIME Type

TommyWillB

Registered
I swear this ought to be easy... I'd like to override Apache's default MIME tye of text/plain for .cfm files.

It seems this can be acomplished two ways:

1) Put "AddType text/html .cfm" in the httpd.conf file

2) Update /private/etc/httpd/mime.types so that it has "text/html html htm cfm"

I've done both, and restared Apache, but it refuses to actually work. Here is the URL of my test page: http://www.jeffntom.com/tom/about_me/background.cfm

This has some JavaScript redirect code (which I know I can do in Apache, but that's not the point).

Unfortunately both Safari and IE ignore MIME types and simply redirect, which masks the problem. Netscape/Mozilla/Firebird actually does the RIGHT thing... which is NOT interpret this as HTML and NOT redirect.

So if I can get Apache to send this file as text/html then I'd expect Netscape/Mozilla/Firebird to redirect just like Safari/IE.

Any ideas on how to make Apache send the correct MIME TYPE?
 
OK, I just copied that background.cfm to my server, made a dummy background.html file, and tested it. Safari does ignore MIME types (really annoying, I had to change some perl source files because of that so they'd display as text...).

I tested it with iCab. First your site, then mine. Yours doesn't appear to be mapping .cfm to text/html.

When I added the AddType text/html .cfm to my httpd.conf file, it did load fine for me. It also immediately redirects (is this what you wanted?) like Safari did.

Maybe you added the line to the httpd.conf file wrong? In my case, I didn't add anything to the mime.types file.

If you'd like to test it - http://dreamstatic.dyndns.org/background.cfm
 
Originally posted by Darkshadow
...Maybe you added the line to the httpd.conf file wrong?...[/url]
  1. mime_module and mime_magic_module are both loaded (I even checked phpinfo() to be sure)
  2. I removed cfm from /private/etc/httpd/mime.types
  3. I've added "AddType text/html .cfm" to the <IfModule mod_mime.c> section (not within any <Directory> or other blocks)of /private/etc/httpd/httpd.conf
  4. I save mime.types and httpd.conf and closed them
  5. I've restarted Apache via the Terminal "httpd restart" (I also did this from the Sharing pref pane to be safe)
  6. I quit and restarted Mozilla Firebird[/list=1]

    I'm still having the problem.

    Does this Add Type need to be somewhere else?
 
A while back, before the v72 beta came out. Still haven't seen anything more on it. Maybe if more people post it as a bug.
 
Back
Top