Command Line Interface Reference Guide > The SLB Configuration Menu
/cfg/slb/layer7/httpmod/rule
HTTP Modification Rule Menu
HTTP modification rules are based on different types of HTTP elements. A rule can be added, removed, or copied. The rules are evaluated according to their priority, with the lowest number getting evaluated first. The maximum number of rules in a rule list is 128.
All rules are evaluated, and all matching rules are performed.
Tip: Radware recommends that you leave a gap between rule numbers that you create so you can easily place future rules within the current hierarchy. For example, create rules 1, 5, and 10 in the event that new rule 3 should be placed between rules 1 and 5, or new rule 7 should be placed between rules 5 and 10.
The following are the rule type menus, based on the HTTP element you enter at the prompt:
URL Modification Menu
[url Modification <Rule List> <Rule Name> 1 Menu]
name - Set rule name
action - Rule action parameters menu
match - Match condition parameters menu
directn - Set rule modification direction
body - Set modifications to also be done in the HTTP body
copy - Copy rule
ena - Enable rule
dis - Disable rule
del - Delete rule
cur - Display current rule configuration
 
URL Modification Menu Options 
Command Syntax and Usage
name
 
The name of the rule that displays in the rule list.
Values: 0 – 31 characters
action
 
Displays the URL Action menu, used to determine which action the URL rule performs.
From the URL Action menu, you can set actions for the following parameters:
*Protocol — HTTP or HTTPS. Default: HTTP
*Port — The port to be set in the URL. Default: 0, meaning:
When the match port is not 0, the port is removed from the URL.
When the match port is not 0, and the port parameter is 0 for both match and action, the port in the URL remains unchanged. That is, if it was explicitly specified it remains as it is, if it was not specified it remains not specified.
*Host — The host action type can be set to insert, replace, or remove:
Insert — Inserts additional text to the hostname, either before or after the matched text.
Replace — Replaces the matched text in the hostname with other text.
Remove — Removes the matched text from the hostname.
None — No action is taken.
Note: Replace and remove are not allowed when the host match type is set to any.
 
When a host match is set, an action must be specified. To use the same host, use the replace action with the same text string in the match.
Example:
Host match type prefix and the host to match www.a match all hosts that start with www.a. Using host action Insert After with host to insert bbb results in the following: host www.a.com is modified to www.abbb.com, and host www.az.com is modified to www.abbbz.com.
*Path — Path action type can be set to insert, replace, or remove.
Insert — Inserts additional text to the path, either before or after the matched text.
Replace — Replaces the matched text in the path with another text.
Remove — Removes the matched text from the path.
None — No action is taken.
Note: Replace and remove are not allowed when the Path Match Type is set to Any.
When using a path match, an action must be specified. To use path match as the match criteria only and use the same path, use the replace action with the same text string in the match.
Example:
Path match type include and path to match abc match any path that contains abc, such as /abc/, /a/abc, and so on. Using path action remove results in the following: path abc is removed, and path de/abc/xyz is modified to de/xyz.
*Pagename — A new page name. Leave this action empty to remove the matched page name.
Note: When both match and action are empty, no operation is performed.
*Pagetype — A new page type. Leave this action empty to remove the matched page type.
Note: When both match and action are empty, no operation is performed.
match
 
Displays the URL Match menu to define the match criteria.
Note: This menu is only for the URL element rules.
Set the match parameters according to the configured rule direction (see the directn command in this table). When the direction is set to bidirectional, set the match parameters to match the server response.
From the URL Match menu, you can set match criteria for the following:
*Protocol — HTTP or HTTPS. Default: HTTP
*Port — The port used in the URL. Default: 0, meaning a match when the port is not explicitly specified in the URL, resulting in using the default port for the specified protocol (80 for HTTP, 443 for HTTPS).
Note: When the port is 0 for both match and action, this implies that the port parameter is not checked (the rule is matched regardless of the port that is in the URL) and not changed.
*Host
Host match type can be set to suffix, prefix, equal, include, or any.
Any implies that any host will match.
Host to match indicates the value for the match.
This parameter is not required when the match type is set to any.

Example:
Host match type prefix and host to match www.a match all hosts that start with www.a, such as www.a.com and www.abc.com.
*Path
Path match type can be set to suffix, prefix, equal, include, or any.
This parameter is not required when match type is set to any. Any implies that any non-empty path match.
Path to match indicates the value for the match.
This parameter is not required when the match type is set to any.

Example:
Path match type include and path to match abc match any path that has abc in it, such as /abc/ and /a/abc.
*Page Name — Used for an exact match of the page name.
For example: hostname.domainname/path/pagename.pagetype
*Page Type — Used for an exact match of the page type.
For example: hostname.domainname/path/pagename.pagetype
directn
 
Determines the rule direction.
Values:
*Request — Only client requests are inspected for modification.
*Response — Only server responses are inspected for modification.
*Bidirectional — The modification is done on the server response, and the reverse modification is done on the subsequent client request. For example, you can remove the complete path from the response so that the same path is added to the subsequent request.
body
 
Enables URL modification in the body.
copy
 
Copies a rule to another rule number in the same rule list. This can also change the priority of a rule.
ena
 
When you configure the HTTP modification rule list, it is disabled by default. For the rule to be operational, you must first enable and apply it.
dis
 
Disables a rule to make it non-operational.
del
 
Deletes this rule.
cur
 
Displays the current rule configuration.
Header Modification Menu
[Header Modification <Rule List> <Rule Name> 1 Menu]
name - Set rule name
action - Set rule action
directn - Set rule modification direction
copy - Copy rule
ena - Enable rule
dis - Disable rule
del - Delete rule
cur - Display current rule configuration
 
Header Modification Menu Options 
Command Syntax and Usage
name
 
The name of the rule that displays in the rule list.
Values: 0 – 31 characters
action
 
Determines the actions the header rule performs.
Values:
*insert — Inserts the header field and value at the beginning of the header area. A value match means a complete word within the value of the header.
Header field — The header field that is inserted.
Alteon lets you optionally use predefined variables in the header field. These variables represent dynamic values that are read from the actual traffic. For a list of these variables, see Replacement Values for HTTP Modification Rule Elements.
Value — The value that is inserted into the header field.
Alteon lets you optionally use predefined variables in the value. These variables represent dynamic values that are read from the actual traffic. For a list of these variables, see Replacement Values for HTTP Modification Rule Elements.
Element to match — One of the following match criteria:
*url — The host and path to match.
*header — The header field and value to match.
*cookie — The cookie key and cookie value to match.
*filetype — The file type to match.
*statusline — The status code and status text to match.
*text — The text to match.
*regex — The regex to match.
*none — No match criteria is defined.
Notes:
If you define match criteria, the insert is performed only if the match is met.
Simple wildcards, such as question marks and asterisks are not considered regex and will not result in the desired behavior. The regex match for the simple wildcard asterisk (*) is dot-asterisk (.*)
Caution: The length of the cookie value must be 28 bytes. If there are fewer than 28 bytes in the cookie header, Alteon corrupts the HTTP header by overwriting the 28 bytes after the cookie key without regard to where the original cookie value ends.
 
*replace — Replaces the matched header name and value with the new header name and value specified.
Header Field — The header field to be replaced.
Alteon lets you optionally use predefined variables in the header field. These variables represent dynamic values that are read from the actual traffic. For a list of these variables, see Replacement Values for HTTP Modification Rule Elements.
Value — The value that will be replaced.
Alteon lets you optionally use predefined variables in the value. These variables represent dynamic values that are read from the actual traffic. For a list of these variables, see Replacement Values for HTTP Modification Rule Elements.
New header field — The new header field.
New Value — The new value.
*remove — The entire matching header field is removed
Header Field — The header field to be removed.
Value — The value that will be removed from the header field.
directn
 
This determines the rule direction.
Values:
*Request — Only client requests are inspected for modification.
*Response — Only server responses are inspected for modification.
*Bidirectional — The modification is done on the server response and the reverse modification is done on the subsequent client request. For example, you can remove the complete path from the response so that the same path is added to the subsequent request
copy
 
Copies a rule to another rule number in the same rule list. This can also change the priority of a rule.
ena
 
When you configure the HTTP modification rule list, it is disabled by default. For the rule to be operational, you must first enable and apply it.
dis
 
Disables a rule to make it non-operational.
del
 
Deletes this rule.
cur
 
Displays the current rule configuration.
Cookie Modification Menu
[cookie Modification <Rule List> <Rule Name> 1 Menu]
name - Set rule name
action - Set rule action
directn - Set rule modification direction
copy - Copy rule
ena - Enable rule
dis - Disable rule
del - Delete rule
cur - Display current rule configuration
 
Cookie Modification Menu Options 
Command Syntax and Usage
name
 
This is the name of the rule that displays in the rule list.
Values: 0 – 31 characters
action
 
Determines which of the following actions the cookie rule performs:
Notes:
If the cookie expiration time is greater than the /cfg/slb/virt x/service x/ptmout value, timed out requests will not be persistent.
The length of the cookie value must be 28.
Values:
*insert — Inserts the following values into the header field:
Cookie key — The cookie key that is inserted.
Alteon lets you optionally use predefined variables in the cookie key. These variables represent dynamic values that are read from the actual traffic. For a list of these variables, see Replacement Values for HTTP Modification Rule Elements.
Cookie value — The cookie value that is inserted.
Alteon lets you optionally use predefined variables in the cookie value. These variables represent dynamic values that are read from the actual traffic. For a list of these variables, see Replacement Values for HTTP Modification Rule Elements.
Cookie path — The cookie path.
Cookie domain — The cookie domain.
Insert-cookie expiration — The date or duration of the cookie insertion expiration.
Cookie expiration — The cookie expiration.
*replace — Replaces the matched cookie key and value with the new specified key and value:
Cookie key — The cookie key to be replaced.
Alteon lets you optionally use predefined variables in the cookie key. These variables represent dynamic values that are read from the actual traffic. For a list of these variables, see Replacement Values for HTTP Modification Rule Elements.
Cookie value — The cookie value.
Alteon lets you optionally use predefined variables in the cookie value. These variables represent dynamic values that are read from the actual traffic. For a list of these variables, see Replacement Values for HTTP Modification Rule Elements.
New cookie key — The new cookie key.
New cookie value — The new cookie value.
*remove — The entire key=value pair is removed from the header. The value specified determines if the header should be removed.
Cookie key — The cookie key to be removed.
Cookie value — The cookie value to be removed.
directn
 
Determines the rule direction:
*Request — The cookie header is modified.
*Response — The Set-Cookie header is modified.
Default: Request
copy
 
Copies a rule to another rule number in the same rule list. This can also be used to change the priority of a rule.
ena
 
When you configure the HTTP modification rule list, it is disabled by default. For the rule to be operational, you must first enable and apply it.
dis
 
Disables a rule to make it non-operational.
del
 
Deletes this rule.
cur
 
Displays the current rule configuration.
File Type Modification Menu
[statusline Modification <Rule List> <Rule Name> 1 Menu]
name - Set rule name
action - Set rule action
directn - Set rule modification direction
copy - Copy rule
ena - Enable rule
dis - Disable rule
del - Delete rule
cur - Display current rule configuration
 
File Type Modification Menu Options 
Command Syntax and Usage
name
 
The name of the rule that displays in the rule list.
Values: 0 – 31 characters
action
 
Determines which of the following actions the file type rule performs.
*replace — Replaces the matched file type with the new file type:
File type — The file type to be replaced.
New file type — The new file type.
*none — No action is performed.
directn
 
Determines the rule direction.
Note: For element file type, the direction is automatically set to request and cannot be updated.
copy
 
Copies a rule to another rule number in the same rule list. This can also be used to change the priority of a rule.
ena
 
When you configure the HTTP modification rule list, it is disabled by default. For the rule to be operational, you must first enable and apply it.
dis
 
Disables a rule to make it non-operational.
del
 
Deletes this rule.
cur
 
Displays the current rule configuration.
Status Line Modification Menu
[statusline Modification <Rule List> <Rule Name> 1 Menu]
name - Set rule name
action - Set rule action
directn - Set rule modification direction
copy - Copy rule
ena - Enable rule
dis - Disable rule
del - Delete rule
cur - Display current rule configuration
 
Status Line Modification Menu Options 
Command Syntax and Usage
name
 
The name of the rule that displays in the rule list.
Values: 0 – 31 characters
action
 
Determines which of the following actions the status line rule performs:
*replace — Replaces the matched status line with the new status line:
Status code — The status code to be replaced.
Status line — The status line to be replaced.
Alteon lets you optionally use predefined variables in the status line. These variables represent dynamic values that are read from the actual traffic. For a list of these variables, see Replacement Values for HTTP Modification Rule Elements.
New status code — The new status code.
New status line — The new status line.
*none — No action is performed.
directn
 
Determines the rule direction.
Note: For element status line, the direction is automatically set to request and cannot be updated.
copy
 
Copies a rule to another rule number in the same rule list. This can also be used to change the priority of a rule.
ena
 
When you configure the HTTP modification rule list, it is disabled by default. For the rule to be operational, you must first enable and apply it.
dis
 
Disables a rule to make it non-operational.
del
 
Deletes this rule.
cur
 
Displays the current rule configuration.
Text Modification Menu
[text Modification <Rule List> <Rule Name> 1 Menu]
name - Set rule name
body - Set modifications to also be done in the HTTP body
action - Set rule action
directn - Set rule modification direction
copy - Copy rule
ena - Enable rule
dis - Disable rule
del - Delete rule
cur - Display current rule configuration
 
Text Modification Menu Options 
Command Syntax and Usage
name
 
The name of the rule that displays in the rule list.
Values: 0 – 31 characters
body include|exclude
 
Enables or disables text modification in the body.
Default: exclude
action
 
Determines which of the following actions the text rule performs:
*replace — Replaces the matched text with the new text:
Text — The text to be replaced.
Alteon lets you optionally use predefined variables in the text. These variables represent dynamic values that are read from the actual traffic. For a list of these variables, see Replacement Values for HTTP Modification Rule Elements.
New text — The new text.
*remove — Removes the matched text with the text.
Text — The text to be removed.
directn
 
Determines the rule direction:
*Request — Only client requests are inspected for modification.
*Response — Only server responses are inspected for modification.
copy
 
Copies a rule to another rule number in the same rule list. This can also change the priority of a rule.
ena
 
When you configure the HTTP modification rule list, it is disabled by default. For the rule to be operational, you must first enable and apply it.
dis
 
Disables a rule to make it non-operational.
del
 
Deletes this rule.
cur
 
Displays the current rule configuration.