Welcome to WebmasterWorld Guest from 54.159.50.111

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Setting MIME types, not via file extensions

     
6:49 pm on Dec 4, 2003 (gmt 0)

Junior Member

10+ Year Member

joined:Mar 19, 2002
posts:120
votes: 0


Anyone know how to set a file's MIME type, if the file is not using a file extension. For example, I want [example.com...] to have a different MIME type, possibly using .htaccess (which I understand slightly).

Help greatly appreciated.

8:51 pm on Dec 4, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 31, 2002
posts:25430
votes: 0


If you are using RewriteRules to redirect that URL to a real page or script, you can append the [T] flag to force the MIME-type -- see the documentation on RewriteRule flags. Another alternative would be to have the script generate all the HTTP response headers, including the MIME-type.

Without any filename or a file extension to 'grab on to', I don't see any other obvious options. (Someone else might, though).

Jim

12:04 am on Dec 5, 2003 (gmt 0)

Junior Member

10+ Year Member

joined:Mar 19, 2002
posts:120
votes: 0


Another alternative would be to have the script generate all the HTTP response headers, including the MIME-type.

Naturally I overlooked the obvious. Thanks.