Forum Discussion
nitass
Apr 26, 2013Employee
you may use HTTP::redirect.
HTTP::redirect wiki
https://devcentral.f5.com/wiki/iRules.http__redirect.ashx
e.g.
[root@ve10:Active] config b virtual bar list
virtual bar {
snat automap
pool foo
destination 172.28.19.252:80
ip protocol 6
rules myrule
profiles {
http {}
tcp {}
}
}
[root@ve10:Active] config b rule myrule list
rule myrule {
when HTTP_REQUEST {
if { [HTTP::host] equals "DNS" and [HTTP::uri] equals "/" } {
HTTP::redirect "http://DNS.mydomain.com/url/url2/"
}
}
}
[root@ve10:Active] config curl -I http://172.28.19.252/ -H "Host: DNS"
HTTP/1.0 302 Found
Location: http://DNS.mydomain.com/url/url2/
Server: BigIP
Connection: Keep-Alive
Content-Length: 0