url redirect to 2 websites

Hi,

I would like to achieve load balancing between 2 urls . They are active passive. So when one is up the other one is down. There is only 1 pool created with the 2 members.

can i do this with an irule

something like this ?

when HTTP_REQUEST { if { [string tolower [HTTP::host]] equals "; } { HTTP::respond 301 Location “[HTTP::uri]” } elseif { [string tolower [HTTP::host]] equals “site2:30900/WebProject” }

Could someone validate ?

tnx a bunch

You are on right track. Note that you will need to look into [HTTP:host] and [HTTP:uri] examples as noted below:

https://devcentral.f5.com/wiki/iRules.HTTP__host.ashx https://devcentral.f5.com/wiki/iRules.HTTP__uri.ashx