Forum Discussion
JosephTrinceri_
Nimbostratus
Mar 01, 2017Need Help with iRule
I'm trying to redirect multiple uri's to an external site to a different path.
this currently works for the exact match i need to set some kind of variable.
elseif { $DTURI starts_with "/logos/zzz.gif" }{ HTTP::redirect "; }
I need something like this..
elseif { $DTURI starts_with "/logos/%variable%.gif" }{ HTTP::redirect "; }
Any help is much appreciated. Thanks!
2 Replies
Try this:
elseif { ([scan $DTURI {/logos/%[^.].gif} string1 ] == 1) } { HTTP::redirect "https://abc.com/logos/${string1}/current/${string1}.gif"; }- Stanislas_Piro2
Cumulonimbus
Hi, you can use this code:
if {[scan $DTURI {/logos/%[^.].gif} variable] > 0} { HTTP::redirect "https://abc.com/logos/$variable/current/$variable.gif" }
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