Forum Discussion
nitass
Dec 12, 2011Employee
e.g.
[root@ve1023:Active] config b rule myrule list
rule myrule {
when HTTP_REQUEST {
if {[class match -- [string tolower [HTTP::uri]] equals uri_redirect]} {
HTTP::redirect "http://[HTTP::host][class match -value [string tolower [HTTP::uri]] equals uri_redirect]"
}
}
}
[root@ve1023:Active] config b class uri_redirect list
class uri_redirect {
{
"/1" { "/3" }
"/2" { "/3" }
"/4" { "/6" }
"/5" { "/6" }
"/7" { "/9" }
"/8" { "/9" }
}
}
[root@ve1023:Active] config curl -I http://172.28.19.79/1
HTTP/1.0 302 Found
Location: http://172.28.19.79/3
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
[root@ve1023:Active] config curl -I http://172.28.19.79/2
HTTP/1.0 302 Found
Location: http://172.28.19.79/3
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
[root@ve1023:Active] config curl -I http://172.28.19.79/4
HTTP/1.0 302 Found
Location: http://172.28.19.79/6
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
[root@ve1023:Active] config curl -I http://172.28.19.79/5
HTTP/1.0 302 Found
Location: http://172.28.19.79/6
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
[root@ve1023:Active] config curl -I http://172.28.19.79/7
HTTP/1.0 302 Found
Location: http://172.28.19.79/9
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
[root@ve1023:Active] config curl -I http://172.28.19.79/8
HTTP/1.0 302 Found
Location: http://172.28.19.79/9
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
[root@ve1023:Active] config curl -I http://172.28.19.79/other
HTTP/1.1 404 Not Found
Date: Mon, 12 Dec 2011 14:23:03 GMT
Server: Apache/2.2.3 (CentOS)
Connection: close
Content-Type: text/html; charset=iso-8859-1