Forum Discussion

Pirlo's avatar
Pirlo
Icon for Nimbostratus rankNimbostratus
Nov 05, 2014

another uri rewrite

Ok i have been stumped 2 or 3 time in the past couple of months with uri rewrites like these.

 

Incoming uri to inspect and grab info from

 

/abc/login.htmlrecord=ABCDEF&origin=Dallas&FirstName=NAME&LastName=SURNAME

 

And the outgoing format it needs to be before hitting the backend

 

/xyz/wci?city=Dallas&firstName=NAME&lastName=SURNAME&record=ABCDEF&language=en

 

I have tried string and trim but my gut tells me i am going wrong down wrong path. And the original uri has no ? so http::query is invalid.

 

What should I be doing?

 

Any assistance would be appreciated or examples to learn from or link.

 

2 Replies

  • i understand browser does not send string after fragment identifier () to bigip. Fragment identifier http://en.wikipedia.org/wiki/Fragment_identifier
  • any URL with symbol never reaches the server (in this case BIG-IP virtual server) as it is a BROWSER identifier. If your application is generating such URLs perhaps it is easier to change the application? If not then you can use the STREAM profile and replace your rogue URLs starting from "/abc/login.htmlrecord=" with "/abc/login.html?record=" in backend RESPONSES in HTTP_RESPONSE event. After that the query string can be accessed with HTTP::query inside the HTTP_REQUEST event and you can carry on with the rewrite logic.