Forum Discussion
Daniel_Frye_222
Nimbostratus
Jul 14, 2005Rewrite host with an iRule?
Hello, hopefully someone knows the answer to this. I'm trying to find a way with an iRule (or any functionality really) to take a url like https://apple.fruit.com/application/xyz.html and convert it t...
unRuleY_95363
Jul 18, 2005Historic F5 Account
I would like to add a note that Joe's example is a good complete example that shows how to abstract the find and replace strings into variables. In reality, you could save some performance in the iRule by replacing the diff variable with the actual literal difference value. For example, "peanut.bean.com" is 15 characters and "apple.fruit.com" is also 15 characters, so instead of calculating: [string length $replace] - [string length $find], simply remove the line for setting the diff variable and also replace the $diff with 0. This optimization logic could also be applied to the find and replace variables as well. Simply using the strings "peanut.bean.com" and "apple.fruit.com" instead of the variables will improve the performance of the iRule. Basically, the more literals you can use vs. evaluating commands, the better the performance will be.
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