Previous Topic: nete:description

Next Topic: Forward and Redirect Syntax

nete:case

The nete:case element provides the destination associated with a specific value for a condition defined in the nete:cond parent element. The SPS uses the value of the nete:case element to evaluate a case.

The definition for the nete:case element is:

<!ELEMENT nete:case (nete:cond | nete:xprcond | nete:forward | nete:redirect | nete:local)>

All nete:case elements must contain one of the following child elements:

nete:cond

nete:case elements can contain additional nete:cond elements. This allows you to nest multiple conditions in a set of proxy rules.

nete:xprcond

nete:case elements can contain additional nete:xprcond elements for regular expression matching of URIs. This allows you to nest a regular expression condition in a set of other conditions.

nete:forward

Provides a destination to which requests that fulfill the nete:case comparison will be forwarded.

nete:redirect

Provides a destination to which requests that fulfill the nete:case comparison will be redirected. Once redirected, requests are fulfilled directly by the destination server, rather than through the SPS.

In the following example, a nete:cond element specifies URI matching, and the nete:case elements demonstrate possible uses of the comparison type attribute.

<nete:cond type="uri" criteria="beginswith">
<nete:case value="/hr">
  <nete:forward>http://hr.company.com$0</nete:forward>
	</nete:case>
	<nete:case value="/employee">
	   <nete:forward>http://employees.company.com$1
			</nete:forward>
	</nete:case>
</nete:cond>

Note: The <nete:forward>URL</nete:forward> elements must be located on the same line. In the example, the </nete:forward> closing tags sometimes appear on a separate line due to space constraints, however, a line break in an actual proxy rules file causes an error. The SPS interprets line breaks before the </nete:forward> closing tag as characters that are part of the URL contained in the nete:forward element.