Forum Discussion

Franki21_136711's avatar
Franki21_136711
Icon for Nimbostratus rankNimbostratus
Oct 30, 2013

Simple iRule to look for /rest in HTTP header

HI, completely new to F5 and irules and looking for a snippet that pass only HTTP requests for URLs beginning with "/rest" in header. Worked with Junos in the past, looks / feels familar but trying to find my way around F5s

 

Thanks in advance

 

1 Reply

  • Assuming you mean URI in this case and not specifically an HTTP header. If so,

    when HTTP_REQUEST {
        if { not ( [string tolower [HTTP::uri]] starts_with "/rest" ) } {
            reject
        }
    }