Forum Discussion
Daniel_Cheng_18
Nimbostratus
Apr 12, 2007Can't convert iRule by OTCU
We found the following iRule can't convert When we upgrade our BIGIP from v4.x to v9.x by OTCU.
if (http_uri matches_regex "/opscommon") {
log "*** client_addr: " + client_addr + ...
hoolio
Cirrostratus
Apr 12, 2007I think this should be functionally equivalent:
if { [HTTP::uri] starts_with "/opscommon"}{
log local0. "client: [IP::client_addr], URI: [HTTP::uri]"
HTTP::redirect "http://[HTTP::host]/opsfop/[HTTP::uri]"
}
else {
pool OPS-PM
}I replaced the regex you had with a string comparison, as it doesn't look like you need to use a regex to verify the URI doesn't start with /opscommon (and a regex is less efficient than a string comparison). You can use matches_regex if you need to though.
Aaron
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
