In a setup where an incoming request is handled by PHP-FPM through "SetHandler "proxy:fcgi:...", the handling PHP script is setting the response header: content-disposition: attachment; filename="foo.pdf" The directive: Header set "content-disposition" "baz" set in a .htaccess file will result in headers: HTTP/1.1 200 OK Server: Apache content-disposition: attachment; filename="foo.pdf" content-disposition: baz [...] Which is unexpected according to what is specified in the documentation of mod_header. "set The response header is set, replacing any previous header with this name. The value may be a format string."
Hi, In the doc, a few lines above what you mention, you have a warning which explains that the 'onsucess" or 'always' "conditions" may give different results depending of your use case. One of this difference is when: - You're modifying or removing a header generated by a CGI script or by mod_proxy_fcgi, in which case the CGI scripts' headers are in the table corresponding to always and not in the default table. This looks like your use case. Does: Header always set "content-disposition" "baz" helps?
You are right. Using "always" solved the issue. You are also right that it is documented in the same segment. However, this whole thing with the different header tables is convoluted and one need some brain power to understand the documentation segment ;-).