I need to be able to test the URL string in a Location response header for a certain pattern and if it matches replace it with another.
e.g. if response is Location: http://wrongserver.com I need to change it to Location: http://rightserver.com
Seems mod_setenvif only operates on request headers so I haven't been able to combine this with a "Header set" directive to achieve what I want.
Content is not being proxied so using mod_proxy directives doesn't seem to be an option.
Thanks, Bernie
You should be able to do this with mod_headers
Header edit Location ^http://wrongserver.com$ http://rightserver.com
More info here: https://httpd.apache.org/docs/current/mod/mod_headers.html#header
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With