Friday 5 August 2016

F5 URI Rewrite-Various Options

when HTTP_REQUEST {

    set uri [ string tolower [HTTP::uri]]

    if { $uri equals "oldpath" } {
        HTTP::uri "/newpath"
    }

}

when HTTP_REQUEST {
 set uri [string tolower [HTTP::uri]]
  if { not ([HTTP::uri] starts_with "/oldpath/") } {
    HTTP::uri /newpath/[HTTP::uri]
  }
}

when HTTP_REQUEST {
    set uri [string tolower [HTTP::uri]]

    if { !($uri starts_with "/oldpath" } {
        HTTP::uri "newpath"
    }
}


when HTTP_REQUEST {
   if { [HTTP::uri] == "oldpath" } {
      HTTP::uri "newpath"
   }
}


when HTTP_REQUEST {
if { [HTTP::uri] == "oldpath" }
{
      { HTTP::uri newpath/ }
}
}