You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Jeff Murch <jm...@cox.net> on 2007/08/10 19:34:36 UTC

[users@httpd] mod_headers mapping problem

I am trying to map the following in my httpd.conf (for a reverse proxy):

header unset "Content-Type: text/html;charset=utf-8"
header add Content-Type "Content-Type: text/html;charset=iso-8859-1"

As you can see I want to change the content type so that some of the
characters render correctly. But the unset won't get rid of the old
Content-Type header and the add won't add the new one.  Can anyone figure
out what I am missing here? I have placed both directives at the very end of
my conf as well as other locations and it made no difference.


Jeff



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] mod_headers mapping problem

Posted by Jeff Murch <jm...@cox.net>.
Wrong again.  SOME of the headers won't unset. Content-Type won't,
Connection won't, but Server will....

Jeff



-----Original Message-----
From: Jeff Murch [mailto:jmurch@cox.net] 
Sent: Friday, August 10, 2007 11:07 AM
To: users@httpd.apache.org
Subject: RE: [users@httpd] mod_headers mapping problem

More info:

It seems that none of the headers will unset.......

Jeff



-----Original Message-----
From: Jeff Murch [mailto:jmurch@cox.net] 
Sent: Friday, August 10, 2007 11:06 AM
To: users@httpd.apache.org
Subject: RE: [users@httpd] mod_headers mapping problem

I changed the syntax in the conf file but still it will not unset the
content-type header and will not let me add the new one. I know that the
directives are working fine as I can add a header with a different name no
problem (Content-Typpe) but that doesn't help.

Are there any special considerations for the Content-Type header directive
maybe when using it in a reverse proxy environment?


header unset Content-Type
header add Content-Type "text/html;charset=iso-8859-1"


Thanks, Jeff





-----Original Message-----
From: Dragon [mailto:dragon@crimson-dragon.com] 
Sent: Friday, August 10, 2007 10:44 AM
To: users@httpd.apache.org
Subject: Re: [users@httpd] mod_headers mapping problem

Jeff Murch wrote:

>I am trying to map the following in my httpd.conf (for a reverse proxy):
>
>header unset "Content-Type: text/html;charset=utf-8"
>header add Content-Type "Content-Type: text/html;charset=iso-8859-1"
>
>As you can see I want to change the content type so that some of the
>characters render correctly. But the unset won't get rid of the old
>Content-Type header and the add won't add the new one.  Can anyone figure
>out what I am missing here? I have placed both directives at the very end
of
>my conf as well as other locations and it made no difference.
>
---------------- End original message. ---------------------

I think your syntax is wonky. I think you want:

Header unset Content-Type
Header add Content-Type "text/html;charset=iso-8859-1"


Dragon

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  Venimus, Saltavimus, Bibimus (et naribus canium capti sumus)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org



-- 
No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.476 / Virus Database: 269.11.11/944 - Release Date: 8/9/2007
2:44 PM



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org



-- 
No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.476 / Virus Database: 269.11.11/944 - Release Date: 8/9/2007
2:44 PM



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org



-- 
No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.476 / Virus Database: 269.11.11/944 - Release Date: 8/9/2007
2:44 PM



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_headers mapping problem

Posted by Joshua Slive <jo...@slive.ca>.
On 8/10/07, Jeff Murch <jm...@cox.net> wrote:
> Thanks Joshua.  I found that it is nod_proxy_html v2 that is causing the
> character set problem. Version 2 only outputs UTF-8. This was corrected in 3
> to allow you to specify a character set. So, I have downloaded the source
> for 3 and compiled it but am not getting the error:
>
> httpd: Syntax error on line 11 of /opt/apache/conf/httpd.conf: API module
> structure `proxy_html_module' in file /opt/apache/modules/mod_proxy_html.so
> is garbled - perhaps this is not an Apache module DSO?
>
> The fun never ends.............

Ouch. I didn't realize what you were trying to do, or I would have
told you to stop earlier. You can't just replace the declared charset
without changing the actual encoding of the content.

One question is why you have a problem with utf-8 in the first place.
It should be well-supported by modern browsers.

If you can't get mod_proxy_html to generate something else, you might
alternatively be able to use mod_charset_lite to change the encoding
properly.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] mod_headers mapping problem

Posted by Jeff Murch <jm...@cox.net>.
Thanks Joshua.  I found that it is nod_proxy_html v2 that is causing the
character set problem. Version 2 only outputs UTF-8. This was corrected in 3
to allow you to specify a character set. So, I have downloaded the source
for 3 and compiled it but am not getting the error:

httpd: Syntax error on line 11 of /opt/apache/conf/httpd.conf: API module
structure `proxy_html_module' in file /opt/apache/modules/mod_proxy_html.so
is garbled - perhaps this is not an Apache module DSO?

The fun never ends.............


Jeff



-----Original Message-----
From: jslive@gmail.com [mailto:jslive@gmail.com] On Behalf Of Joshua Slive
Sent: Friday, August 10, 2007 12:04 PM
To: users@httpd.apache.org
Subject: Re: [users@httpd] mod_headers mapping problem

On 8/10/07, Jeff Murch <jm...@cox.net> wrote:
> Would you please show me an example of how I would unconditionally rewrite
> the character-type header from utf-8?
>
> I am trying, and I know the syntax is more like pseudocode:
>
> RewriteEngine On
> rewriterule ^C"Content-Type: text/html;charset=utf-8" "Content-Type:
> text/html;charset=iso-8859-1"

Woh!

Have you looked at the mod_rewrite docs? Yes, they are intimidating,
but they are better than blind guessing ;-)

An example would be:
RewriteRule .* - [T="text/html;charset=iso-8859-1"]

But I have my doubts that would actually work. I don't know what
mod_rewrite will do with the charset, and I don't know what would
happen in a proxy context.

I'll repeat that I think the simplest way to do this is a quick and
dirty apache module.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org



-- 
No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.476 / Virus Database: 269.11.11/944 - Release Date: 8/9/2007
2:44 PM



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_headers mapping problem

Posted by Joshua Slive <jo...@slive.ca>.
On 8/10/07, Jeff Murch <jm...@cox.net> wrote:
> Would you please show me an example of how I would unconditionally rewrite
> the character-type header from utf-8?
>
> I am trying, and I know the syntax is more like pseudocode:
>
> RewriteEngine On
> rewriterule ^C"Content-Type: text/html;charset=utf-8" "Content-Type:
> text/html;charset=iso-8859-1"

Woh!

Have you looked at the mod_rewrite docs? Yes, they are intimidating,
but they are better than blind guessing ;-)

An example would be:
RewriteRule .* - [T="text/html;charset=iso-8859-1"]

But I have my doubts that would actually work. I don't know what
mod_rewrite will do with the charset, and I don't know what would
happen in a proxy context.

I'll repeat that I think the simplest way to do this is a quick and
dirty apache module.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] mod_headers mapping problem

Posted by Jeff Murch <jm...@cox.net>.
Would you please show me an example of how I would unconditionally rewrite
the character-type header from utf-8?

I am trying, and I know the syntax is more like pseudocode:

RewriteEngine On
rewriterule ^C"Content-Type: text/html;charset=utf-8" "Content-Type:
text/html;charset=iso-8859-1"


Jeff




-----Original Message-----
From: jslive@gmail.com [mailto:jslive@gmail.com] On Behalf Of Joshua Slive
Sent: Friday, August 10, 2007 11:37 AM
To: users@httpd.apache.org
Subject: Re: [users@httpd] mod_headers mapping problem

On 8/10/07, Jeff Murch <jm...@cox.net> wrote:
> Wouldn't using RewriteCond be able to do that?

No. RewriteCond can act on request headers but not response headers
(since mod_rewrite must do rewriting before the response is written).

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org



-- 
No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.476 / Virus Database: 269.11.11/944 - Release Date: 8/9/2007
2:44 PM



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_headers mapping problem

Posted by Joshua Slive <jo...@slive.ca>.
On 8/10/07, Jeff Murch <jm...@cox.net> wrote:
> Wouldn't using RewriteCond be able to do that?

No. RewriteCond can act on request headers but not response headers
(since mod_rewrite must do rewriting before the response is written).

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] mod_headers mapping problem

Posted by Jeff Murch <jm...@cox.net>.
Wouldn't using RewriteCond be able to do that?

Jeff



-----Original Message-----
From: jslive@gmail.com [mailto:jslive@gmail.com] On Behalf Of Joshua Slive
Sent: Friday, August 10, 2007 11:14 AM
To: users@httpd.apache.org
Subject: Re: [users@httpd] mod_headers mapping problem

On 8/10/07, Jeff Murch <jm...@cox.net> wrote:
> More info:
>
> It seems that none of the headers will unset.......

Standard protocol-required headers like Content-Type, Connection, etc,
can't generally be manipulated with mod_headers.

mod_rewrite can manipulate content-type, but I don't think it will
help in your case because it can't act conditionally on an existing
request header.

I see two solutions:

1. Fix your upstream server to not send garbage encoding values.

2. Write a custom apache module that would use the proper API to test
and reset the content-type. It would be very simple, but would require
figuring out something about apache modules.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org



-- 
No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.476 / Virus Database: 269.11.11/944 - Release Date: 8/9/2007
2:44 PM


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_headers mapping problem

Posted by Joshua Slive <jo...@slive.ca>.
On 8/10/07, Jeff Murch <jm...@cox.net> wrote:
> More info:
>
> It seems that none of the headers will unset.......

Standard protocol-required headers like Content-Type, Connection, etc,
can't generally be manipulated with mod_headers.

mod_rewrite can manipulate content-type, but I don't think it will
help in your case because it can't act conditionally on an existing
request header.

I see two solutions:

1. Fix your upstream server to not send garbage encoding values.

2. Write a custom apache module that would use the proper API to test
and reset the content-type. It would be very simple, but would require
figuring out something about apache modules.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] mod_headers mapping problem

Posted by Jeff Murch <jm...@cox.net>.
More info:

It seems that none of the headers will unset.......

Jeff



-----Original Message-----
From: Jeff Murch [mailto:jmurch@cox.net] 
Sent: Friday, August 10, 2007 11:06 AM
To: users@httpd.apache.org
Subject: RE: [users@httpd] mod_headers mapping problem

I changed the syntax in the conf file but still it will not unset the
content-type header and will not let me add the new one. I know that the
directives are working fine as I can add a header with a different name no
problem (Content-Typpe) but that doesn't help.

Are there any special considerations for the Content-Type header directive
maybe when using it in a reverse proxy environment?


header unset Content-Type
header add Content-Type "text/html;charset=iso-8859-1"


Thanks, Jeff





-----Original Message-----
From: Dragon [mailto:dragon@crimson-dragon.com] 
Sent: Friday, August 10, 2007 10:44 AM
To: users@httpd.apache.org
Subject: Re: [users@httpd] mod_headers mapping problem

Jeff Murch wrote:

>I am trying to map the following in my httpd.conf (for a reverse proxy):
>
>header unset "Content-Type: text/html;charset=utf-8"
>header add Content-Type "Content-Type: text/html;charset=iso-8859-1"
>
>As you can see I want to change the content type so that some of the
>characters render correctly. But the unset won't get rid of the old
>Content-Type header and the add won't add the new one.  Can anyone figure
>out what I am missing here? I have placed both directives at the very end
of
>my conf as well as other locations and it made no difference.
>
---------------- End original message. ---------------------

I think your syntax is wonky. I think you want:

Header unset Content-Type
Header add Content-Type "text/html;charset=iso-8859-1"


Dragon

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  Venimus, Saltavimus, Bibimus (et naribus canium capti sumus)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org



-- 
No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.476 / Virus Database: 269.11.11/944 - Release Date: 8/9/2007
2:44 PM



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org



-- 
No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.476 / Virus Database: 269.11.11/944 - Release Date: 8/9/2007
2:44 PM



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] mod_headers mapping problem

Posted by Jeff Murch <jm...@cox.net>.
I changed the syntax in the conf file but still it will not unset the
content-type header and will not let me add the new one. I know that the
directives are working fine as I can add a header with a different name no
problem (Content-Typpe) but that doesn't help.

Are there any special considerations for the Content-Type header directive
maybe when using it in a reverse proxy environment?


header unset Content-Type
header add Content-Type "text/html;charset=iso-8859-1"


Thanks, Jeff





-----Original Message-----
From: Dragon [mailto:dragon@crimson-dragon.com] 
Sent: Friday, August 10, 2007 10:44 AM
To: users@httpd.apache.org
Subject: Re: [users@httpd] mod_headers mapping problem

Jeff Murch wrote:

>I am trying to map the following in my httpd.conf (for a reverse proxy):
>
>header unset "Content-Type: text/html;charset=utf-8"
>header add Content-Type "Content-Type: text/html;charset=iso-8859-1"
>
>As you can see I want to change the content type so that some of the
>characters render correctly. But the unset won't get rid of the old
>Content-Type header and the add won't add the new one.  Can anyone figure
>out what I am missing here? I have placed both directives at the very end
of
>my conf as well as other locations and it made no difference.
>
---------------- End original message. ---------------------

I think your syntax is wonky. I think you want:

Header unset Content-Type
Header add Content-Type "text/html;charset=iso-8859-1"


Dragon

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  Venimus, Saltavimus, Bibimus (et naribus canium capti sumus)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org



-- 
No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.476 / Virus Database: 269.11.11/944 - Release Date: 8/9/2007
2:44 PM



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] mod_headers mapping problem

Posted by Jeff Murch <jm...@cox.net>.
Thanks Dragon.

What if I only want it remapped when the Content-Type is UTF-8?

Jeff



-----Original Message-----
From: Dragon [mailto:dragon@crimson-dragon.com] 
Sent: Friday, August 10, 2007 10:44 AM
To: users@httpd.apache.org
Subject: Re: [users@httpd] mod_headers mapping problem

Jeff Murch wrote:

>I am trying to map the following in my httpd.conf (for a reverse proxy):
>
>header unset "Content-Type: text/html;charset=utf-8"
>header add Content-Type "Content-Type: text/html;charset=iso-8859-1"
>
>As you can see I want to change the content type so that some of the
>characters render correctly. But the unset won't get rid of the old
>Content-Type header and the add won't add the new one.  Can anyone figure
>out what I am missing here? I have placed both directives at the very end
of
>my conf as well as other locations and it made no difference.
>
---------------- End original message. ---------------------

I think your syntax is wonky. I think you want:

Header unset Content-Type
Header add Content-Type "text/html;charset=iso-8859-1"


Dragon

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  Venimus, Saltavimus, Bibimus (et naribus canium capti sumus)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org



-- 
No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.476 / Virus Database: 269.11.11/944 - Release Date: 8/9/2007
2:44 PM



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_headers mapping problem

Posted by Dragon <dr...@crimson-dragon.com>.
Jeff Murch wrote:

>I am trying to map the following in my httpd.conf (for a reverse proxy):
>
>header unset "Content-Type: text/html;charset=utf-8"
>header add Content-Type "Content-Type: text/html;charset=iso-8859-1"
>
>As you can see I want to change the content type so that some of the
>characters render correctly. But the unset won't get rid of the old
>Content-Type header and the add won't add the new one.  Can anyone figure
>out what I am missing here? I have placed both directives at the very end of
>my conf as well as other locations and it made no difference.
>
---------------- End original message. ---------------------

I think your syntax is wonky. I think you want:

Header unset Content-Type
Header add Content-Type "text/html;charset=iso-8859-1"


Dragon

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  Venimus, Saltavimus, Bibimus (et naribus canium capti sumus)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org