Robert_47833
Sep 26, 2011Altostratus
Hi,how to set domain in this situation
Dear irule
in one irule,there are 2 types request
https://1.cjj.com/aaaa
https://1.cjj.co.uk/aaaa
I want to redirect them to my.1.cjj.com or .co.uk
elseif {$uri starts_with "/aaaa"} {
if { [HTTP::host] ends_with ".co.uk"} {
HTTP::redirect https://my.1.cjj.co.uk
}
elseif {[HTTP::host] ends_with ".com"} {
HTTP::redirect https://my.1.cjj.com
}
my question is :
because there are 4 other places in this irule need use redirect this types uri
should I configure something like this to avoid use if /elseif in each condition
set domain [domain [HTTP::host] 2]
but in order to handle 1.cjj.com and 1.cjj.co.uk together ,how to achieve this?
if {HTTP::host] ends_with ".co.uk} {
set domain [domain [HTTP::host] 3]
}
elseif {HTTP::host] ends_with ".com} {
set domain [domain [HTTP::host] 2]
}
is this one right?
do u have someone who is better than mine,pls show me
Thanks in advance