Forum Discussion
Mario_9378
Nimbostratus
Nov 13, 2007Rewriting URLs (stripping out prefix)
I'm new to iRules and I would like to be able to do something like so:
if URI starts with /2.4/rest_of_URL then
goto pool X but strip out 2.4 and have /rest_of_URL seen at destination
if URI starts with /2.5/rest_of_URL then
goto pool Y but strip out 2.5 and have /rest_of_URL seen at destination
I've done this type of thing with Apache's mod_rewrite/mod_proxy, brain dead easy.
Anyway, f5 management is a very minor aspect of what I do day to day and I didn't want to expend lots of time with experimentation and/or trying to find examples when I'm sure there's a domain expert here that can answer the question trivially.
Regards,
-M
3 Replies
- JRahm
Admin
when HTTP_REQUEST { if { [HTTP::uri] starts_with "/2.4/" } { HTTP::uri [string replace [HTTP::uri] 0 3] pool x } elseif { [HTTP::uri] starts_with "/2.5/" } { HTTP::uri [string replace [HTTP::uri] 0 3] pool y } }
RE: I didn't want to expend lots of time with experimentation and/or trying to find examples ...
The notion that your time is more valuable than the members of the community on which you lean...not liking that very much. - JRahm
Admin
Come to think of it, since the string characters are numbers, you don't need the tolower parameter. Edited for clarity in previous post. - Mario_9378
Nimbostratus
Citizen thanks for the information... regarding your closing comment, I'm not implying my time is better than anyone else's -- I came here to get an answer from domain experts. Take it at face value.
Cheers,
-M
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
