Setting Header Content-Type on Apache

Setting Header Content-Type on Apache

Post by Ehud Rege » Fri, 18 Apr 1997 04:00:00



Hello !

Our web server provides documents in hebrew.
We were using the meta tag in the html to change the charset to
iso-8859-8 . Though, it appears that Netscape browsers 3.x and 4.x have
a bug which causes documents, in which a switch in the charset was made
using the meta tag, to be redrawn . It looks like the page reloads
twice.

After looking into the problem we though that if we cane change the
header Content-Type which the server sends to include charset iso-8859-8
it will not have to redraw the page. Indeed, on CGI scripts, in which we
can set the headers, this solution worked.
My question is how can I set the default header that Apache sends to be
Content-Type: text/html; charset=iso-8859-8 Instead of the usual one ?


TIA,
Ehud Regev
Hebrew University of Jerusalem

 
 
 

Setting Header Content-Type on Apache

Post by Ken A L Coa » Thu, 15 May 1997 04:00:00



> After looking into the problem we though that if we cane change the
> header Content-Type which the server sends to include charset iso-8859-8
> it will not have to redraw the page. Indeed, on CGI scripts, in which we
> can set the headers, this solution worked.
> My question is how can I set the default header that Apache sends to be
> Content-Type: text/html; charset=iso-8859-8 Instead of the usual one ?

This is not currently possible without hacking the Apache sources.
However, it is on the list of things to be considered in a future
version after 1.2.  In the meantime, keep an eye on the existing
request for this at <http://www.apache.org/bugdb.cgi/full/241>.

#ken    :-)}

 
 
 

Setting Header Content-Type on Apache

Post by Paul Sutto » Fri, 16 May 1997 04:00:00




>> After looking into the problem we though that if we cane change the
>> header Content-Type which the server sends to include charset iso-8859-8
>> it will not have to redraw the page. Indeed, on CGI scripts, in which we
>> can set the headers, this solution worked.
>> My question is how can I set the default header that Apache sends to be
>> Content-Type: text/html; charset=iso-8859-8 Instead of the usual one ?

>This is not currently possible without hacking the Apache sources.
>However, it is on the list of things to be considered in a future
>version after 1.2.  In the meantime, keep an eye on the existing
>request for this at <http://www.apache.org/bugdb.cgi/full/241>.

Umm, this is what I thought too. But a quick test shows you can
put mime parameters in both mime.types and AddType lines if you
double quote them. E.g. inside mime.types

      "text/html; charset=iso-8859-8"    html htm

or on AddType and DefaultType lines, e.g.

   DefaultType "text/html; charset=iso-8859-8"  

Of course the real issue is if the browser can handle parameters -
a long time ago, most couldn't so this was discouraged. Maybe they
can now.

Paul
Apache Week ... latest Apache news ... http://www.apacheweek.com/

 
 
 

Setting Header Content-Type on Apache

Post by Alan J. Flavel » Sat, 17 May 1997 04:00:00


..

Quote:> put mime parameters in both mime.types and AddType lines if you
> double quote them. E.g. inside mime.types

>       "text/html; charset=iso-8859-8"    html htm

> or on AddType ...

Well, on NCSA I found that

AddType text/html;charset=iso-8859-7 html7

(or whatever) worked just fine.  Wouldn't this work on Apache too?  As I
read the HTTP spec (correct me if I'm wrong), white space is optional at
that point, so I avoided the problem by leaving it out.

Quote:> Of course the real issue is if the browser can handle parameters -
> a long time ago, most couldn't so this was discouraged. Maybe they
> can now.

That would be an excellent reason not to send charset=iso-8859-1, since
that is and always was the published default[1].  But if you need to
change from the default charset, then sending it in an HTTP header seems
to me to be the best way - better than fooling around with META
HTTP-EQUIV, and much better than expecting the reader to perform some
manual jiggering around in their browser!!

[1] Yes, I am aware that some communities of users got accustomed to
working with a non-standard default, but, now that these islands of the
Web are getting better interconnected, let's talk about how to
do the job _right_, for the World-Wide web, is that OK?

 
 
 

Setting Header Content-Type on Apache

Post by Paul Sutto » Sat, 17 May 1997 04:00:00


 Alan J. Flavell wrote in article ...


>> put mime parameters in both mime.types and AddType lines if you
>> double quote them. E.g. inside mime.types

>>       "text/html; charset=iso-8859-8"    html htm

>Well, on NCSA I found that

>AddType text/html;charset=iso-8859-7 html7

>(or whatever) worked just fine.  Wouldn't this work on Apache too?  As I
>read the HTTP spec (correct me if I'm wrong), white space is optional at
>that point, so I avoided the problem by leaving it out.

Yes, that works fine in Apache too. The problem as reported was that
some browsers could not distinguish the mime parameter from the
mime-type unless there was a space in there as well (yes, the browsers
are broken).

Paul
Apache Week ... latest Apache news ... http://www.apacheweek.com/

 
 
 

1. Capturing Content-Type header on Apache

Hi everyone:
I am trying to capture the content-type header apache is sending out to
make sure it is sending out the correct mime type.

I am having a problem, for some reason Frontpage makes my index.htm file
on the root web "index.phtml", I don't know what that means, but I had to
add "addtype text/html .htm .phtml" to my srm.conf file. I added it with
and
without the initial period, and edited the mime.types file as well.

Well, for most browsers, it works, but one guy's netscape here keeps
thinking
it is application/x-httpd-phtml ?? When I telnet to port 80 and do a GET /
I
see the "Content-Type: text/html" header, so I don't know why it's not
working
for this guy. I reset the ini files for netscape and still get the error,
but only on
that one copy of netscape.

But really, how come I can't get the content-type header to show up in my
access_log file? I am using the mod-log-config (I think that is the name,
my telnet
is screwed right now) library and have tried the following:
%{Content-type}i %{Content-type}o", I tried capitalizing the T in type,
but
nothing. It keeps giving "-" dashes in place of the header in my
access_log file.

And why the heck is MS making my file "phtml", when it is just a static
html page? Geez, they won't support "shtml", but they screw with all my
settings....

Thanks
Chris Buchholz

2. Problems with dip and mgetty

3. Apache 1.3.20: ap_send_http_header() sends Content-Type header when response contains no body

4. X11R6 Setup

5. Apache not sending Content-type: headers. Why?

6. Question About Form Submition...

7. APACHE: Setting the Content-Type from HTML

8. Plotter questions

9. Content-Type Header Field

10. Help: (mail) content-length/type headers not set

11. content-type not set

12. How to set Content-Type: text/html; version=3.0

13. Apache and multipart/mixed Content-type