Narsimha
Narsimha

Reputation: 31

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

Upvotes: 3

Views: 720

Answers (1)

Garvit Jain
Garvit Jain

Reputation: 2022

Here is the solution

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

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

Upvotes: 2

Related Questions