Forum Discussion
Steve-S_87321
Nimbostratus
Aug 30, 2007I-rule to redirect using regular expression
Hello,
I need to know how to write an irule to redirect to a server using port 8080 if a keyword or regular expression is included in the uri. Without the keyword it should go to the same s...
Steve-S_87321
Nimbostratus
Sep 04, 2007The following string is being used -
http://bsccsupplierpayables2.sysco.com/imageserver/getimage?folders=1463,52c,52b,52b,52b,52b&docids=1ba54,788a5,1fb73,1fb74,1fdf2,1fdf7
I have tried two different irules and neither works. Please help. The keyword that changes is getimage and so that is what I am trying
to use. It seems like the irule is not catching it. The 8080 pool references the server using port 8080. The 80 pool references the same server but using port 80. If it works correctly a PDF file will be called and load. When it doesn't I get an invalid file request so it is easy to test.
First version -
if (tolower(http_uri) contains "getimage") {
use pool bscc.sysco.com-8080
}
else {
use pool bscc.sysco.com-80
}
2nd version -
if (http_uri contains "getimage") {
use pool bscc.sysco.com-8080
}
else if (http_uri matches_regex "(reportNames)") {
use pool bscc.sysco.com-8080
}
else if (http_uri matches_regex "(reportParams)") {
use pool bscc.sysco.com-8080
}
else if (http_uri matches_regex "(getReport)") {
use pool bscc.sysco.com-8080
}
else if (http_uri matches_regex "(getimage)") {
use pool bscc.sysco.com-8080
}
else {
use pool bscc.sysco.com-80
}
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