ltm rule command HTTP is redirect
iRule(1) BIG-IP TMSH Manual iRule(1)
HTTP::is_redirect
Returns a true value if the response is a redirect.
SYNOPSIS
HTTP::is_redirect
DESCRIPTION
Returns a true value if the response is a redirect. Since only
responses can be redirects, it does not make sense to use this command
in a clientside event.
Syntax
HTTP::is_redirect
* Returns a true value if the response is a redirect. Note that
status codes 300 and 304 are not considered redirects by this
command. This command is synonymous with HTTP::header
is_redirect.
* The following response codes cause HTTP::is_redirect to return a
match (and all include a Location header directing the browser to
an alternate resource):
* 301 (Moved Permanently)
* 302 (Found)
* 303 (See Other)
* 305 (Use Proxy)
* 307 (Temporary Redirect)
Note: For pre-9.2.0 versions you can use HTTP::header is_redirect for
the same purpose.
RETURN VALUE
VALID DURING
CACHE_REQUEST, CACHE_RESPONSE, HTTP_REQUEST, HTTP_REQUEST_DATA,
HTTP_RESPONSE, HTTP_RESPONSE_CONTINUE, HTTP_RESPONSE_DATA,
HTTP_PROXY_RESPONSE
EXAMPLES
when HTTP_RESPONSE {
if { [HTTP::is_redirect] } {
log local0. "Request redirected."
}
}
HINTS
SEE ALSO
CHANGE LOG
@BIGIP-9.2.0 --First introduced the command.
BIG-IP 2017-01-31 iRule(1)