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 sample1 pool.
I need the sample1 to remain at the end of the url like this: www.samplesite.com/sample1.
Can someone point me to an existing irule sample that does this or point me in the right direction to get started with this?
Thanks
- A_tech_85188
Nimbostratus
Thanks for your reply Hoolio, - hoolio
Cirrostratus
That 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: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" }
- A_tech_85188
Nimbostratus
Hi, - hoolio
Cirrostratus
If you want to get the whole path minus the leading slash, you could either use 'string range [HTTP::path] 1 end', or 'string trimleft [HTTP::path] "/"'. - A_tech_85188
Nimbostratus
Hi Aaron, - hoolio
Cirrostratus
The syntax looks good. I'm still not 100% sure about the logic for the URIs though. In typical applications, every request wouldn't be to a single path, so the idea of assigning a pool based on the path wouldn't work. I suppose it's possible if the content for the app is generated based just off of the parameters and parameter values.
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