Forum Discussion
yuanqiang_22112
Nimbostratus
Apr 26, 2016irulse for url limit
Hi
I have a host "http://ocean.jiedaibao.com.cn" load balance through F5 LTM, but I do not want this URL "http://ocean.jiedaibao.com.cn/admin/system/login/?redirect=/admin" through F5 LTM . The ...
Stanislas_Piro2
Cumulonimbus
Apr 28, 2016You can replace condition
[string tolower [HTTP::query]] contains "redirect=/admin"
with (this will search
redirect parameter in query string and filter on the parameter value)
[string to lower [URI::query [HTTP::uri] redirect]] starts_with "/admin"
or
[string to lower [URI::query [HTTP::uri] redirect]] equals "/admin"
One other recommendation is to filter on HTTP::path instead of HTTP::uri if login string is in path part of the URI.
The final iRule can be:
when RULE_INIT {
set static::admin_datagroup "admin_datagroup"
}
when HTTP_REQUEST {
if {([HTTP::path] ends_with "/login/") && ([string to lower [URI::query [HTTP::uri] redirect]] starts_with "/admin")&& ! [class match [IP::client_addr] equals $static::admin_datagroup]} {
HTTP::respond 404
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects