Forum Discussion
A_tech_85188
Nimbostratus
May 01, 2008Pool Redirect
Hello All,
I need to setup an irule, but am newbie to irule's.
I need it to do this.
When someone puts in www.samplesite.com/sample1
it directs them to the sample...
hoolio
Cirrostratus
May 07, 2008That looks about right. Is the portion of the URI always the same length? ie, are your pool names pool_SAMPLE1, pool_SAMPLE2, etc? If so, you can change the command to:
set pool_string [string toupper [string range [HTTP::path] 1 7]]
You can test the string range command using a simplified test rule:
when RULE_INIT {
Save a test path
set ::path "/sample1/path/to/file.ext"
Starting with the / as positiion 0, parse the path
set ::pool_string [string toupper [string range $::path 1 7]]
log local0. "\$::pool_string: $::pool_string"
}Here is the sample output from /var/log/ltm:
Rule : $::pool_string: SAMPLE1
Once you get that working, you can use the same command in the normal iRule. Just replace the test variable $::path with [HTTP::path].
set pool_string [string toupper [string range [HTTP::path] 1 7]]
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