Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I copy a apache web server response variable to a new response header variable

I have a requirement where I would like a response variable to be copied to a new header variable. i.e. a response variable called "Location" and to be copied to "X-Location". From apache documentation I can see that I can set new headers or edit existing headers but I cannot seem to be able to copy a existing header to another header. I am using apache 2.2 . Any pointers ?

Thanks Narsimha

like image 644
Narsimha Avatar asked Mar 27 '26 12:03

Narsimha


1 Answers

Here is the solution

Header set X-Location "expr=%{resp:Location}"

This will copy response header Location to response header X-Location

like image 158
Garvit Jain Avatar answered Mar 31 '26 06:03

Garvit Jain



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!