Re: server setting the content-type
robm@ncsa.uiuc.edu (Rob McCool)
Message-id: <9312301846.AA26584@void.ncsa.uiuc.edu>
From: robm@ncsa.uiuc.edu (Rob McCool)
Date: Thu, 30 Dec 1993 12:46:29 -0600
In-Reply-To: Bob Stayton <bobs@sco.com>
"server setting the content-type" (Dec 30, 10:24am)
X-Mailer: Mail User's Shell (7.2.5 10/14/92)
To: Bob Stayton <bobs@sco.com>, www-talk@nxoc01.cern.ch
Subject: Re: server setting the content-type
Content-Length: 1981
/*
* server setting the content-type by Bob Stayton (bobs@sco.com)
* written on Dec 30, 10:24am.
*
* Is there any way to have the NCSA server set the content
* type of a file as text/html if it starts with the <HTML>
* tag rather than by its filename extension?
Unfortunately not.
* Our site has a mixture of character and graphical terminals, so we
* are trying to use both mosaic and lynx. I've noticed an
* inconsistency between the two in reading HTML files from an
* NCSA 1.0 server.
*
* - In mosaic, an HTML file named "foo" will display as
* formatted text if it contains a <TITLE> tag.
*
* - In lynx, such a file will be interpreted as text and
* display the HTML tags. In order for it to be shown as
* formatted text, I had to change my server's srm.conf file to:
*
* DefaultType text/html
*
* so that the delivered document has the proper Content-type
* header for HTML. But that means text files will be
* interpreted as HTML also and not display properly.
*
* We have good reasons not to add ".html" to each
* HTML document, but we also don't want to add .txt
* to every text document.
*
* I talked with Lou Montulli about the inconsistency
* and he suggested that it should be the server that
* types a file, not the client. I seem to agree with
* him, hence my question.
Yes, he is right, it's the server's problem. Unfortunately there isn't too
much that can be done in the current framework to help you... MIME typing is
currently all done either by filename extension or explicit config.
directives (AddType in .htaccess files).
* It would seem pretty
* easy for the server to look at the top of the file for the
* <HTML> signature and deliver it with that content-type.
*/
Um, well, it would be easy, but I don't think it should be done, since
binary files that happen to begin with <HTML> will confuse the server. If
it's a solution that works for you, hacking it in should not be any big
deal.
--Rob