Issue
I have a Apache2 server on Ubuntu for proxy server. I want to change content-type
of response to client to another but it will remove charset
too.
# /etc/apache2/sites-available/000-default.conf
Header set Content-Type "text/html" "expr=%{resp:Content-Type} =~ m|text/abcdefgh|"
With this setting, when it see the header which content-type is text/abcdefgh
or text/abcdefgh; charset=utf-8
or text/abcdefgh; charset=shift_jis
, it will become text/html
without charset
- Is there any way to change part of
content-type
byHeader set
orothers
? - Where can I find the meaning of this pattern?
Many thanks!
Solution
Did you try to use edit
instead of set
?
Header edit Content-Type "text/abcdefgh" "text/html"
It should just replace text/abcdefgh
with text/html
but leave the charset as is
Answered By - Capsule Answer Checked By - Willingham (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.