httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier>
Subject [users@httpd] Problem with mod_headers ?
Date Tue, 30 Dec 2008 17:48:36 GMT

I am a bit at my wit's end here.

Using Apache 2.2.3 under Suse Linux, with a mod_jk re-director to Tomcat 
for certain links, such as the one of which question below.

I am using a Tomcat java application which unfortunately sets the 
Content-Type response header wrongly : it says "text/html; 
charset=iso-8859-1" instead of "text/html; charset=iso-8859-2", and 
there is no way I can change that application itself.
So I am trying to rectify that header after-the-fact, using mod_headers.
Unfortunately, it does not seem to work.

I have this Vhost configuration (snippet) :

SetEnvIf REQUEST_URI "/servlet\.[^\.]+$" is-jk
Header always set Content-Type: "text/html; charset=ISO-8859-2" env=is-jk
Header always set Test-Header: "VHost level" env=is-jk
<LocationMatch "/servlet\.[^.]+$">
   SetHandler jakarta-servlet
   Header always set Content-Type: "text/html; charset=ISO-8859-2"
   Header always set Test-Header: "Location level"

I capture the HTTP headers resulting from a request, using the 
LiveHttpHeaders plugin of Firefox, as follows (sorry for the email 
wrap-around, and sensitive bits edited-out with XXX):

POST /starweb/XXX/servlet.starweb HTTP/1.1
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv: 
Gecko/20080623 Firefox/
Accept-Language: en-gb,en;q=0.7,de-de;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache
Content-Type: application/x-www-form-urlencoded
Content-Length: 273

HTTP/1.x 200 OK
Date: Tue, 30 Dec 2008 17:30:33 GMT
Server: Apache/2.2.3 (Linux/SUSE) mod_jk/1.2.28-dev-727724 
mod_perl/2.0.2 Perl/v5.8.8
Content-Type: text/html;charset=ISO-8859-1
Test-Header: Location level
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Pragma: no-cache
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked

As can be seen above, the "Test-Header" that I set with mod_headers 
comes out perfectly, from the Location section.
But the Content-Type header, which I believe should be set in the same 
exact conditions, does not.

Does anyone have an idea why ?


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message