irule that routes to multiple domain names

I can’t seem to get the syntax right for this rule, so I thought I would bother the forum for a nice concise answer, hopefully! I want to have an irule that splits 1 VIP into multiple domain names. I have been working on the following rule:

when HTTP_REQUEST {

if { [HTTP::host] eq “www.domain1.com” } {

pool domain1 }

elseif { [HTTP::host] eq “www.domain2.com” } {

pool domain2 }

}

Thanks in advance for anyone’s help regarding this inquiry!

Regards,

Chris S.

i think you have a space after the end of

elseif { [HTTP::host] eq “www.domain2.com” } {

remove that space and it should work better..

Thanks, this worked!

For a slight variation check out this thread:

Click here DevCentral - An F5 Technical Community

-Brian