I am using a IHS to route the incoming url to my application by Rewrite Rule. But i also want url to be saved so that i can use it within my application.
So my question is whether, we can copy the incoming URL to the Message HTTPHeader before performing the rewrite rule.
For eg:
Incoming Request
url:
http://abc.test/pqr/MPP
HTTP Body:
{
"xml": {
"name": "testName",
"item": { "invoice": "447632938" }
}
}
To be converted to
url:
http://xyz.test/targetApp/ss
HTTP Header:
Context:"pqr/MPP"
HTTP Body:
{
"xml": {
"name": "testName",
"item": { "invoice": "447632938" }
}
}
I tried to use the below code to set the Header, but the header came as null
SetEnvIf REQUEST_URI "(.*)/pqr/MPP" HTTP_CONTEXT=REQUEST_URI
RequestHeader set HTTP_CONTEXT %{HTTP_CONTEXT}e