Forum Discussion
I-rule redirect advise
Hi cgwin12,
[HTTP::uri]
Returns or sets the URI part of the HTTP request.
https://clouddocs.f5.com/api/irules/HTTP__uri.html
[HTTP::path]
Returns or sets the path part of the HTTP request. The path is defined as the path and filename in a request. It does not include the query string.
https://clouddocs.f5.com/api/irules/HTTP__path.html
[HTTP::query]
Returns the query part of the HTTP request. The query is defined as the part of the request past a ? character, if any.
https://clouddocs.f5.com/api/irules/HTTP__query.html
[HTTP::host]
Returns the value contained in the Host header of an HTTP request.
https://clouddocs.f5.com/api/irules/HTTP__host.html
For the following URL:
https://mysite.com/content1/anythingelse.html?a=123
[HTTP::uri] : /content1/anythingelse.html?a=123
[HTTP::path] : /content1/anythingelse.html
[HTTP::query] : a=123
[HTTP::host] : mysite.com
iRule:
when HTTP_REQUEST {
if { [HTTP::has_responded] } { return }
if { [HTTP::host] eq "ccsweb.lanl.gov" && [string tolower [HTTP::uri]] eq "/~pakin" } {
HTTP::redirect "https://lanlexperts.elsevierpure.com/en/persons/scott-d-pakin"
return
}
elseif { [HTTP::host] eq "ccsweb.lanl.gov" } {
HTTP::redirect "https://cta.lanl.gov"
return
}
}
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com