I have Chinese clients that provide the following in their http request headers:

Accept-Language: zh-cn,zh;q=0.5

This is causing problems with characters being dropped by our load balancer. Is there any way for Apache to rewrite those headers or to override the Accept-Language as:

Accept-Language: en,zh-cn,zh;q=0.5
link|improve this question
feedback

1 Answer

I do not think you can rewrite Client headers (not with the mod_xxx I know of) - but you can tailor the URL that's being sent with mod_rewrite - see this page, for instance.

link|improve this answer
Thanks, but ideally I'd like to only use one URL. The problem is that if the user provides 'zh-cn' as the language the response contains Chinese characters that cannot be handled by the load balancer. For some reason if the user specifies 'en' these characters are automatically converted/dropped. Ideally the application developers should handle those foreign characters, but currently that isn't an option, so I'd like to force Apache to sanitise the response. – Zecrates Feb 7 at 10:44
Uhm. Language negotiation and error handling should allow you to send pretty much any file as response - including one that does not contain chinese characters. That's broken, but so appears to be the load balancer :-) – Alien Life Form Feb 7 at 10:50
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.