F5 iRule has the following 3 command list that can be a bit confusing. This is a short post to remember the differences between the 3 of them.
[HTTP::uri] – everything from “/” after the domain name to the end.
[HTTP::path]– everything from “/” after the domain name to the character before the “?”
[HTTP::query]– everything after the “?”
[HTTP::host] – domain name
In short:
[HTTP::uri] == [HTTP::path] + ? + [HTTP::query]
Example:
http://www.example.com/main/index.jsp?user=test&login=check
[HTTP::uri] - URI: /main/index.jsp?user=test&login=check [HTTP::path] - PATH: /main/index.jsp [HTTP::query] - Query: user=test&login=check [HTTP::host] - Host: www.example.com
Hi Vidal,
I have one question.
I want to show the text message as ‘mobile browser will not work and please use your desktop’
When the traffic coming from different URI such as
https://dell.abc.com/hr-forms/register
https://dell.abc.com/hr-forms/rest
You would need something like this (rough framework):
when HTTP_REQUEST {
if mobile browser {
if { ([HTTP::host] eq “dell.abc.com”) and ([HTTP::uri] eq “/hr-forms/rest”)} {
HTTP::respond 200 content [ifile get browser-wont-work.html] “Content-Type” “text/html”
}
}
}
In the above iRule, you have to use [HTTP::header “User-Agent”] to identify the mobile browser.