Jump to content
Welcome to our new Citrix community!

Search and collect GET variable and rewrite URL to new location

Recommended Posts

To redirect, you might be better off with a responder policy, if you want to tell the user to go to a new location.

If you just want to modify the request server side, then use rewrite.  For more complicated transformations, then url transform would be preferred.


For an example URL:


http.req.url.query.value("search_criteria") will match on <stuff>

If you need to validate that the query value only contains certain characters. or do different redirects/rewrites based on its contents, then we might need a different expression.


If this isn't exactly what you want to do, feel free to add more details and clarify.  But see if either of these help you accomplish what you want.


#1 Responder Action (using a relative path redirect):

add responder action rs_pol_sendto_tracking redirect "\"/my/shipment-tracking/?type=PRO&query=\" + http.REQ.URL.QUERY.VALUE(\"search_critieria\").HTTP_URL_SAFE" -responseStatusCode 302


You can then figure out the policy expression needed to trigger this action.


#2 Rewrite Action (to change request URL into new format...)

add rewrite action rw_act_replaceurl replace http.REQ.URL.PATH_AND_QUERY "\"/my/shipment-tracking/?type=PRO&query=\" + http.REQ.URL.QUERY.VALUE(\"search_criteria\").HTTP_URL_SAFE"

However, if you need the user to continue to see the public view of the URL as /WebApp/ShipmentTracking/<stuff> while you change it into the server side format /my/shipment-trakcing/?<stuff>  and then do the inverse on any links embedded in the response and transform them back into the public format. Then you would need URL transform.

Depending on the complexity of the app and where additional query parameters are or aren't present. If you think you need this, let me know.










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