Forum Discussion

JosephTrinceri_'s avatar
JosephTrinceri_
Icon for Nimbostratus rankNimbostratus
Mar 01, 2017

Need 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";
    }
    
  • Hi, you can use this code:

     

    if {[scan $DTURI {/logos/%[^.].gif} variable] > 0} {
        HTTP::redirect "https://abc.com/logos/$variable/current/$variable.gif"
    }