Forum Discussion
nitass
Feb 09, 2012Employee
please feel free to revise.
[root@ve1023:Active] config b virtual bar list
virtual bar {
snat automap
pool foo
destination 172.28.19.79:80
ip protocol 6
rules myrule
profiles {
http {}
tcp {}
}
}
[root@ve1023:Active] config b rule myrule list
rule myrule {
when HTTP_REQUEST {
set host [string tolower [HTTP::host]]
set newhost [string map {".acme.com.nz" ""} $host]
if {$host ne $newhost} {
HTTP::redirect "http://$newhost[HTTP::uri]"
}
}
}
[root@ve1023:Active] config curl -I http://172.28.19.79/whatever -H "Host: xxxx.acme.com.nz"
HTTP/1.0 302 Found
Location: http://xxxx/whatever
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
[root@ve1023:Active] config curl -I http://172.28.19.79/whatever -H "Host: www.yahoo.com.acme.com.nz"
HTTP/1.0 302 Found
Location: http://www.yahoo.com/whatever
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
[root@ve1023:Active] config curl -I http://172.28.19.79/whatever -H "Host: www.yahoo.com.au.acme.com.nz"
HTTP/1.0 302 Found
Location: http://www.yahoo.com.au/whatever
Server: BigIP
Connection: Keep-Alive
Content-Length: 0