Jump to content
Welcome to our new Citrix community!

Rewrite a string in a Request Header

Recommended Posts

I am wanting to replace a specific string "work.nation.com" (bold string below)in a request header with the value "apps.cloud.com" leaving everything else the same. What would be the best rewrite policy and  action to accomplish this? 






Link to comment
Share on other sites


action type: replace

target expression:  http.req.header("<header name>").substr("work.nation.com")

value (to replace):  "app.nation.com"



add rewrite action rw_act_demorw replace 'http.REQ.HEADER("<header name>").SUBSTR("work.nation.com")'  '"apps.cloud.com"'


There are multiple ways to do this with different expression structures; but if this is truly a header value and not a path element, then this should work.

the replace action targets the value of the header (http.req.header("<header name>") and then finds the instance of "work.nation.com" in that header value (if only one occurrence.

The replace value then replaces it with "apps.cloud.com"


Double check whether this is a request time or response time rewrite. I didn't know which header you were rewriting.





  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...