Forum Discussion
gpoverland
Nimbostratus
Jul 08, 2008IRule that rewrites URI based on Pool or PoolMember Selected
I am trying to create an Irule that selects to rewrite a URI based on which pool member is chosen. Why you ask, well this is to accomodate the slow migration from an older application to a newer appli...
gpoverland
Nimbostratus
Jul 24, 2008Trying to make this case insensitive... tried forcing the URI when it is stored to force it lower case, but for some reason its not working.. Is this the correct way to do this and what am I doing wrong?
when HTTP_REQUEST_SEND {
Save the URI to avoid running this command multiple times.
set uri [clientside [string tolower {HTTP::uri}]]
log local0. "[IP::client_addr]:[TCP::client_port]: \$uri: $uri"
log local0. "[IP::client_addr]:[TCP::client_port]: selected server details: [LB::server]"
Check if the selected server is .3 or .4
if {[IP::addr [LB::server addr] equals 10.207.225.101] or [IP::addr [LB::server addr] equals 10.207.225.102] or [IP::addr [LB::server addr] equals 10.207.225.103]} {
log local0. "[IP::client_addr]:[TCP::client_port]: matched server check for .3 or .4"
Check if the URI contains the first string
if {$uri contains "/gsfo/gsfopub"} {
Update the URI
clientside {HTTP::uri "/Async/CMReceive.ashx"}
log local0. "[IP::client_addr]:[TCP::client_port]: updated URI to /Async/CMReceive.ashx"
Check if the URI contains the second URI
} elseif {$uri contains "/era/erapub" }{
Update the URI
clientside {HTTP::uri "/Async/ERAReceive.ashx"}
log local0. "[IP::client_addr]:[TCP::client_port]: updated URI to /Async/ERAReceive.ashx"
Check if the URI contains the third URI
} elseif {$uri contains "/utilities/servconntest" }{
Update the URI
clientside {HTTP::uri "/Async/ServConnTest.ashx"}
log local0. "[IP::client_addr]:[TCP::client_port]: updated URI to /Async/ServConnTest.ashx"
Check if the URI contains the Forth URI
} elseif {$uri contains "/leadseai/cmemailleadpub" }{
Update the URI
clientside {HTTP::uri "/Async/CMEmailLeadPub.ashx"}
log local0. "[IP::client_addr]:[TCP::client_port]: updated URI to /Async/CMEmailLeadPub.ashx"
Check if the URI contains the Fifth URI
} elseif {$uri contains "/leadseai/salesleadpub" }{
Update the URI
clientside {HTTP::uri "/Async/SalesLeadPub.ashx"}
log local0. "[IP::client_addr]:[TCP::client_port]: updated URI to /Async/SalesLeadPub.ashx"
} else {
Take some default action?
log local0. "[IP::client_addr]:[TCP::client_port]: didn't match URI checks"
}
}
}