Forum Discussion

tony_100112's avatar
tony_100112
Icon for Nimbostratus rankNimbostratus
Jan 06, 2009

how to use irule for this URL redirection

URL format:

 

http://rs.ovi.com.cn/;ST;P1;P2;P3;P4;P5;P6;TimeStamp;TargetURL

 

the TargetURL will redirect user to ,it must be URL encoded

 

So if TargetURL=www.google.com ,will redirect user to www.google.com

 

How can I use irule to implement this URL rediection?

 

Thanks in advance

 

  • James_Quinby_46's avatar
    James_Quinby_46
    Historic F5 Account
    Hello.

    Assuming that TargetURL is always in the same place, this should work:

      
      when HTTP_REQUEST {  
        
      set dest [lindex [split [HTTP::uri] ";"] 9]  
      log local0.info "dest = $dest"  
      HTTP::redirect "http://${dest}"  
        
      }  
      

    It works on my lab setup, in any case.