jake_macabuag_4
Nov 07, 2012Nimbostratus
URL rewrite
Hello everyone
I'm a newbie when it comes to irules and i am trying to create URL rewrite rule for web server load balancing. Basically, the local web server can be accessed via http://HOST/trendsnet_com_ph. I cannot access the site without the URI. If I create a VS, i need to append the URI instead of just using the URL. I created 2 irules and both are not working or I am doing it incorrectly.
Rule 1
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri] ] {
"/" {
HTTP::uri "/trendsnet_com_ph"
}
}
}
Rule 2
when HTTP_REQUEST {
if { [HTTP::uri] equals "/" } {
HTTP::uri "/trendsnet_com_ph"
}
}
Appreciating everyones help
thanks