Forum Discussion
Michiel_61345
Apr 18, 2012Nimbostratus
class match hostname in 10.2.1 irule
Guys,
My website www.mycomp.com also has some country specific domain registration addresses. Customers visiting my website on a regional address need to be routed to my .com address and get...
nitass
Apr 18, 2012Employee
e.g.
[root@ve1023:Active] config b virtual bar list
virtual bar {
snat automap
pool pool_mycomp
destination 172.28.19.79:80
ip protocol 6
rules myrule
profiles {
http {}
tcp {}
}
}
[root@ve1023:Active] config b class website_aliases list
class website_aliases {
{
"www.mycomp.de"
"www.mycomp.fr"
"www.mycomp.nl"
}
}
[root@ve1023:Active] config b rule myrule list
rule myrule {
when HTTP_REQUEST {
if { [class match -- [HTTP::host] equals website_aliases] } {
HTTP::redirect "http://www.mycomp.com"
}
}
}
[root@ve1023:Active] config curl -I http://www.mycomp.com
HTTP/1.1 200 OK
Date: Wed, 18 Apr 2012 13:21:10 GMT
Server: Apache/2.2.3 (CentOS)
Last-Modified: Fri, 11 Nov 2011 14:48:14 GMT
ETag: "4183e4-3e-9c564780"
Accept-Ranges: bytes
Content-Length: 62
Content-Type: text/html; charset=UTF-8
[root@ve1023:Active] config curl -I http://www.mycomp.de
HTTP/1.0 302 Found
Location: http://www.mycomp.com
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects