Philip_IT_71995
Jun 28, 2012Nimbostratus
Redirect URL path to maintenance pool
I have an irule display problem (below iRule) for redirecting URL path to maintenance page's pool.
The request is that LTM need to redirect the URL path www.server.com/News/ to Maintenance page. The other URL path route to default pool. www.server.com/News/* to Maintenance page. www.server.com/* to Normal server page (default pool)
The result was that the “News” client can be redirected to maintenance pool for showing the content of index.html page but all images and web styles are missed. If I changed the default pool to maintenance pool, the maintenance page can display images and web styles properly.
Can someone help me to solve the irule problem?
=========
iRule Name: Redirect News URL to Maintenance only
when HTTP_REQUEST {
irule for when we are using News
if { [string tolower [HTTP::uri]] contains "/News/" }
{ log local0. "client [IP::client_addr] requested /News/ page"
log local0. "client [IP::client_addr] redirecting"
if { [TCP::local_port] == 443 }
{ HTTP::redirect "http://[getfield [HTTP::host] ":" 1 ][HTTP::uri]" }
HTTP::uri "/index.html"
pool "Pool_Maint"
}
===Maintenance Pool===
Name: Pool_Maint
Member==> 10.10.10.2:9088
Page=> Index.html
===Default Pool===
Name: Pool_Server_http
Member ==> 10.10.10.1:80
Name: Pool_Server_https
Member ==> 10.10.10.1:443