book
Article ID: CTX633190
calendar_today
Updated On:
Description
Delete first entry from URL path using responder
Resolution
To delete the first entry from a URL using a responder, we can use the `HTTP.REQ.URL.PATH` expression to manipulate the URL.
However, please note that the Netscaler responder does not support direct URL manipulation.
We can create a responder policy that matches the URL pattern we want to change and then redirect to a new URL.
Here is an example of how we can do this:
- Create a responder action that redirects to the new URL:
- add responder action act_redirect redirect '"http://newurl.com" + HTTP.REQ.URL.PATH_AND_QUERY.AFTER_STR("/firstentry").HTTP_URL_SAFE
- Create a responder policy that matches the URL pattern: add responder policy pol_url 'HTTP.REQ.URL.PATH_AND_QUERY.BEFORE_STR("/").EQ("/firstentry")' act_redirect
- Bind the responder policy on your Virtual server: bind lb vserver <Virutal server Name> -policyName pol_url -priority 100
- In this example, the `HTTP.REQ.URL.PATH_AND_QUERY.AFTER_STR("/firstentry").HTTP_URL_SAFE` expression gets the part of the URL after "/firstentry", and the `HTTP.REQ.URL.PATH_AND_QUERY.BEFORE_STR("/").EQ("/firstentry")` expression matches URLs that have "/firstentry" as the first entry in the path.
Problem Cause
Responder Policy
Issue/Introduction
In this example, the `HTTP.REQ.URL.PATH_AND_QUERY.AFTER_STR("/firstentry").HTTP_URL_SAFE` expression gets the part of the URL after "/firstentry", and the `HTTP.REQ.URL.PATH_AND_QUERY.BEFORE_STR("/").EQ("/firstentry")` expression matches URLs that have "/firstentry" as the first entry in the path.
Created a responder policy and bound to virtual server.