Forum Discussion

Peak10_RAL_Engi's avatar
Peak10_RAL_Engi
Icon for Nimbostratus rankNimbostratus
May 21, 2010

http path match not working

 

I have an existing irule that matches incoming http requests to various path text strings and if there is a match, it sends those requests to a different pool then the default pool configured on that virtual server. I've added some new redirects that need to match, and so far they are not matching on my tests. I was hoping that someone could help me troubleshoot why the example below is not matching:

 

 

Current irule:

 

 

when HTTP_REQUEST {

 

switch -glob [string tolower [HTTP::path]] {

 

}

 

"*.asp" -

 

"*.aspx" -

 

pool pool_B

 

log local0. "pool_B chosen."

 

}

 

default {

 

pool pool_A

 

log local0. "pool_A."

 

}

 

}

 

}

 

 

I want to add the following text match to redirect to pool_B:

 

 

"/?abc=de"

 

 

When I add it as follows:

 

 

when HTTP_REQUEST {

 

switch -glob [string tolower [HTTP::path]] {

 

}

 

"*.asp" -

 

"*.aspx" -

 

"/?

 

pool pool_B

 

log local0. "pool_B chosen."

 

}

 

default {

 

pool pool_A

 

log local0. "pool_A."

 

}

 

1 Reply

  • Your going to have to change to [HTTP::uri]

     

     

    Example: http://www.website.com/subcontent?abc=de

     

     

    [HTTP::host] = www.website.com

     

    [HTTP::path] = /subcontent

     

    [HTTP::uri] = /subcontent?abc=de

     

     

    Path - http://devcentral.f5.com/wiki/default.aspx/iRules/http__path.html

     

    URI - http://devcentral.f5.com/Wiki/default.aspx/iRules/http__uri.html

     

     

    or

     

     

    You could do an [HTTP::query] compare.

     

     

    Query - http://devcentral.f5.com/wiki/default.aspx/iRules/http__query