Ed_27995
May 29, 2008Nimbostratus
iRule to set Fallback Host based on user ID
Hi All,
Extremely new to iRules and TCL scripting. I have created the code for an iRule, syntax checks as correct, as follows:
when HTTP_REQUEST {
if {[findstr [HTTP::uri] "webctid=" 8 2] == "83"}
{HTTP::fallback "http://web_address_here/page.asp"}
elseif {[findstr[HTTP::uri] "webctid=" 8 2] == "95"}
{HTTP::fallback "http://web_address_here/page.asp"}
}
The intent of the rule is to redirect student accounts, identified by an id starting with "83" or "95" to a maintenance page explaining why access is restricted, while allowing faculty, administrator, and other accounts normal access.
Questions I have are:
- Does this look like it'll work?
- Will the 2 findstr and comparison operations introduce a lot of latency into the BigIP operations?
- Is there a better way to do this? Maybe a single digit extract and a "string is digit" comparison?
Thanks!
Ed