Jump to content
Welcome to our new Citrix community!

Replacing URI path on LB vserver (after being directed to LB vserver by a CS vserver)?

Recommended Posts

Wondering how I would I go about replacing a portion of the URI path from one thing to another.


example:  https://hostname.com/aaa/test to https://hostname.com/xxx/test.  


I have a content switching vserver that has a content switching policy set to look for "aaa" in the URI path and send them to a load balanced virtual server.   But the backend server that the load balanced vserver uses doesn't house the path "aaa" (and the devs can't change it).  The server houses the path "xxx".  Thus the need to swap out "/aaa" with "/xxx" in the path.


I thought if by setting up the following rewrite action and policy and attaching it to the LB vserver, that it would do what I need:

  • add rewrite action rw_act_replace_aaa_with_xxx replace HTTP.REQ.URL.PATH "\"/xxx\""
  • add rewrite policy rw_pol_replace_aaa_with_xxx "HTTP.REQ.URL.PATH.STARTSWITH(\"/aaa\")" rw_pol_replace_aaa_with_xxx


The CS vserver works just fine.  It is properly sending users to the correct LB vserver.  I can also see the rewrite policy and action getting hits.  It's just that when the LB server gets the request, the rewrite action doesn't seem to be re-writing like it should.  It seems to be shuffling it along with the request-URI "/aaa" intact.


Any help you could offer me would be greatly appreciated.

Link to comment
Share on other sites

  • 2 weeks later...
  • 4 weeks later...
On 8/21/2022 at 11:10 AM, Stefan Wielers said:



check this:

using: http.REQ.URL.PATH.GET(1)


add rewrite action rw_pol_replace_aaa_with_xxx replace "http.REQ.URL.PATH.GET(1)" "\"xxx\""
add rewrite policy rw_pol_replace_aaa_with_xxx 'HTTP.REQ.URL.SET_TEXT_MODE(IGNORECASE).STARTSWITH("/aaa")' rw_pol_replace_aaa_with_xxx




Sorry for taking so long to reply - I've been bogged down with tons of project work as of late.  But in event, you're policy seems to do the trick.  Thanks Stefan!  

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...