Forum Discussion
iRule Array with string map redirects not working
Hello, I think you are combining curly braces with variables and this avoids their expansion. So, it should be something like this:
HTTP::respond 302 noserver Location "$new_destination[string map "$web_uri [HTTP::uri]" [HTTP::uri]]"
However, I think that the result will not be what you expect with those combinations, then, as a first shot, you could do like this:
HTTP::respond 302 noserver Location "$new_destination[string range [HTTP::uri] [expr [string len $web_uri]+1] end]"
Anyway, why do you not do that by using "data group" and "class match" to avoid iteration in their arrays? Maybe it could be more easy to do.
https://devcentral.f5.com/wiki/iRules.class.ashx
Another point,is the second part that seems to have the same effect when the operator "equals" and "starts_with", will have the same final execution, then it seems to me to be redundant and unnecessary to use the first operator "equals". Sorry if I did not analyze as a whole.
I think that's all, I hope I have helped you!
Regards.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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