Product Documentation

Example 8: Redirect Queries to the Queried Server

Mar 20, 2012
Example Inc. wants to redirect query requests to the appropriate server, as shown here.
  • Request: GET /query.cgi?server=5HOST:
  • Redirect URL:

To implement this redirection, you would first create a rewrite action with the values in the following table.

Action Name Type of Rewrite Action Expression to choose target reference String expression for replacement text
Action-Rewrite-Replace_Hostheader REPLACE HTTP.REQ.HEADER("Host").BEFORE_STR("") "server-" + HTTP.REQ.URL.QUERY.VALUE("web")
You would then create a rewrite policy with the values in the following table.
Policy Name Action Name Undefined Action Expression
Policy-Rewrite-Replace_Hostheader Action-Rewrite-Replace_Hostheader NOREWRITE HTTP.REQ.HEADER("Host").EQ("")

Finally, you would bind the rewrite policy, assigning it a priority of 900. Because this policy should be the last policy applied to a request that matches its criteria, you set the goto expression to END.

Incoming requests to any URL that begins with are redirected to the server number in the query.