irule redirect on uri including default location
Im having trouble with requests that i need to redirect based on uri. My irule is
when HTTP_REQUEST { switch -glob [string tolower [HTTP::uri]] { "/test/" - "/test1/" { HTTP::redirect "http://redirected.server.com[HTTP::uri]" } default { pool POOL_MainPool_Server-80 } } }
I want to have any request that is for www.request.com/test to go to second server.
It works fine for any request that includes the / eg: www.request.com/test/ but not without the / If i remove the / from my irule eg "/test" then any request such as www.request.com/testing also redirects but I dont want it to.
Also I dont want it picking up on the secondary level eg /Firstlevel/test/ I want the exact match of /test/ but include if the request is just default page /test
Does anyone now how I would go about this?
Thanks in advance Brett