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 my website shown.
IMHO, most decent way to do this is to use a data group for this, put in the country specific domain names and match the domain name request against the data group entries and do a redirect.
Implementation:
I've created a string type data group named "website_aliases"
Filled it with string/values equal to domainname/pool (pool is not used as an reference but each string needs a value), a couple of examples:
www.mycomp.de pool_mycomp
www.mycomp.fr pool_mycomp
www.mycomp.nl pool_mycomp
The in the irule:
when HTTP_REQUEST {
set host [string tolower [HTTP::host]]
set uri [string tolower [HTTP::uri]]
switch -exact $host {
"www.mycomp.com" {
pool pool_mycomp
}
if {[class match $host equals website_aliases]} {
HTTP::redirect http://www.mycomp.com/ }
}
}
Irule is accepted so contains no syntax errors.
Still after synch, when trying in a browser http://www.mycomp.com , it is reinitialised
Any of the aliases also don't work either so https://www.mycomp.de is not redirected to http://www.mycomp.com
Any ideas?