Forum Discussion
Ed_27995
Nimbostratus
May 29, 2008iRule 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
- hoolio
Cirrostratus
Hi Ed, - Ed_27995
Nimbostratus
Hi Aaron,
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