https://issues.apache.org/bugzilla/show_bug.cgi?id=50525
Summary: Header directive won't edit Location header from
ProxyPass or RewriteRule
Product: Apache httpd-2
Version: 2.2.15
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P3
Component: mod_headers
AssignedTo: [email protected]
ReportedBy: [email protected]
mod_header documentation and internet discussion seemed to indicate that I
could fix a mistaken Location: header using the Header directive. However, this
did not seem to work in the two cases that I tried.
1. ProxyPass:
ProxyPass / http://google.com/
# which of course gets a 301 to www.google.com
Header always edit Location: goo gar
# so we should go to www.gargle.com
Header always add X-Foo: bar
# just put that in to make sure Header was working at all
The response in this case includes these headers:
X-Foo: bar
Location: http://www.google.com/
So, Location was unaffected.
2. RewriteRule
RewriteEngine on
RewriteRule ^.* http://www.foo.com/ [R]
# so everything is redirected to www.foo.com
Header always edit Location: foo bar
# which should modify it to www.bar.com
Header always add X-Foo: bar
The response then includes:
X-Foo: bar
Location: http://www.foo.com/
Again, Location was unaffected.
If the Location header is added with Header, then a later edit does work. But I
can't get it to affect proxied responses, which is what I really wanted. The
docs don't indicate any reason why this should fail. So either the docs or
mod_headers should be fixed.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]