Forum Discussion
jpvrenen_46954
Nimbostratus
Mar 28, 2009Redirect using regular expressions
Hi all,
Just looking for some feedback on my iRule, it is working but would like to hear if it looks ok like this or if it can be written in a better/easier way using coding I am not aware of....
hoolio
Cirrostratus
Mar 30, 2009Hi Jeroen,
I think that's about as good as you can get it. You could potentially use a few string commands to find the start of /Beer/now.html in /find/some/*_Server1_*/Beer/now.html, but I think it would be overly complicated.
If you do stick with the regex, you could update the regex to /find/some/.*_[Ss]erver1_.*?/ as .*?/ will match anything up to the first /.
Also, you could get rid of the intermediate variable:
HTTP::redirect "http://www.heineken.nl/want/[regsub {/find/some/.*_[Ss]erver1_.*?/} $uri ""]"
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