Forum Discussion
There are many departments: department1, department2, department3, etc... and I don't know what they are or will be. So I like the the "department1/user" or "department2/user" to be the "/user" but I am not sure how to insert the department wildcard in the http redirect (HTTP::redirect "http://[HTTP::host]/).
I am trying with "getfield". I modified the iRules to be like these: when HTTP_REQUEST { if the request is from the trusted network segments if {[IP::addr [IP::client_addr] equals 10.10.10.5/32] or [IP::addr [IP::client_addr] equals 192.168.100.0/24]} { log local0. "First IF" pool seattle-only return } if the request is from untrusted network segment switch -glob [string tolower [HTTP::uri]] { "/user" { HTTP::redirect "http://[HTTP::host]" } "/*/user" { set new-uri [getfield [HTTP::uri] "/" 2 HTTP::redirect "http://[HTTP::host]/$new-uri" } default { pool seattle-only } } }
but unsuccessful