Forum Discussion
Ed_27995
Nimbostratus
Jun 18, 2008iRule seems to block page request
Hi All,
I have created the following iRule-
when HTTP_REQUEST {
if {[findstr [HTTP::uri] "webctid=" 8 2] == "83"}
{HTTP::redirect "http://distance-ed.bcc.ct...
Jun 18, 2008
Found at least one of your issues. You don't have a space between the second "findstr" and "[HTTP::uri]". The TCL processor is trying to run the command "findstr[HTTP::uri]" which throws a runtime exception that you should see in the /var/log/ltm file.
I've got an alternative for your iRule that should work and speed things up a bit.
when HTTP_REQUEST {
switch [findstr [HTTP::uri] "webctid=" 8 2] {
"83" -
"95" {
log local0. "Found match, redirecting to maintenance page..."
HTTP::redirect "http://distance-ed.bcc.ctc.edu/bbmaint.asp"
}
}
}
This avoids the multiple parsing by calling findstr twice and easily allows for new webctid's in the future.
Let me know if this does or doesn't work.
-Joe
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
