Forum Discussion

5 Replies

    • Richard__Harlan's avatar
      Richard__Harlan
      Historic F5 Account
      then all you have to do is update the HTTP::rediret "http://new.f5.com/TRIGGER/calendar/render?tab=ncmain_7"
  • in case you want to make it a bit more dynamic.

    by the way, i think fragment identifier part (starting with hashmark) is not sent to bigip.

    Fragment identifier

    http://en.wikipedia.org/wiki/Fragment_identifier
     configuration
    
    [root@ve11c:Active:In Sync] config  tmsh list ltm rule qux
    ltm rule qux {
        when RULE_INIT {
      set static::removal "/abc/"
      set static::hostname "www.f5.com"
      set static::newhostname "new.f5.com"
    }
    when HTTP_REQUEST {
      if { [HTTP::host] eq $static::hostname } {
        HTTP::redirect "http://${static::newhostname}[string map [list $static::removal "/"] [HTTP::uri]]"
      }
    }
    }
    
     test
    
    [root@ve11c:Active:In Sync] config  curl -I http://www.f5.com/abc/TRIGGER/whatever/whatever
    HTTP/1.0 302 Found
    Location: http://new.f5.com/TRIGGER/whatever/whatever
    Server: BigIP
    Connection: Keep-Alive
    Content-Length: 0
    
    [root@ve11c:Active:In Sync] config  curl -I http://www.f5.com/abc/TRIGGER/calendar/render?tab=ncmain_7
    HTTP/1.0 302 Found
    Location: http://new.f5.com/TRIGGER/calendar/render?tab=ncmain_7
    Server: BigIP
    Connection: Keep-Alive
    Content-Length: 0
    
    
  • Thanks for the reply. Yes I need it more dynamic. The examples I used are not clear. Sorry about that.

     

    Original string http://www.f5.com/abc/TRIGGER/doc/1234

     

    Redirect string http://new.f5.com/abc/TRIGGER/doc/1234

     

    Using the suggestions above, I came up with the following rule. I will try and test.

     

    when RULE_INIT { set static::newhostname "new.f5.com" } when HTTP_REQUEST { if { [HTTP::uri] contains "TRIGGER" }{ HTTP::redirect "http://${static::newhostname}[HTTP::uri]]" } }